Under construction

Still being built. Things may change

Cactus graph edge removal

Time limit1sMemory limit512 MB

Summary
Delete uniformly random edges one at a time from a cactus graph until it disconnects, and output the expected number of deletions to six decimals.
Level

Medium7 of 10

Topics
Probability, Graph, DFS, Math
Solved
No attempts yet

Problem

A cactus graph is a connected undirected graph in which every two distinct simple cycles share at most one vertex. A simple cycle is a cycle that does not repeat a vertex. In a cactus graph, no two such cycles overlap in two or more vertices.

You play a game on a given cactus graph. In each step you pick one of the remaining edges and delete it. The edge is picked uniformly at random among all remaining edges, and the choices in different steps are independent. The game ends once the graph is no longer connected, that is, once there are two vertices with no path between them.

Compute the expected number of steps until the game ends.

Input

The first line contains the number of vertices nn and the number of edges mm. (1≤n≤6001 \le n \le 600, 1≤m≤n(n−1)/21 \le m \le n(n-1)/2) The vertices of the graph are numbered from 11 to nn.

Each of the next mm lines contains two different integers aa and bb. (1≤a,b≤n1 \le a, b \le n) They mean that an edge joins vertex aa and vertex bb.

At most one edge joins any two vertices, and the given graph is a cactus graph as described above.

Output

Print the expected number of steps until the game ends on one line. Round it to six places after the decimal point and print exactly six digits after the decimal point.

Examples2

  1. Example 1

    Input
    4 4
    1 2
    2 3
    3 1
    1 4
    
    Expected output
    1.750000
    
  2. Example 2

    Input
    12 14
    1 2
    2 3
    3 1
    2 4
    4 5
    6 5
    3 7
    7 8
    8 9
    9 10
    10 7
    8 11
    8 12
    11 12
    
    Expected output
    2.175824