King Graff, the ruler of the land of Feerie, has a problem - his nation
is under attack! Luckily, he has an army at his disposal, composed of a
whopping
Feerie consists of
Graff's only real concern is with his enemies using a divide-and-conquer strategy. His soldiers will be susceptible to this type of attack if there exists any single road that, if blocked, will prevent them from reaching each other by any system of connected roads. As the royal computer scientist, your job is to determine the probability that King Graff will be defeated.
Input Specification
Line 1: 2 integers,
Next
Output Specification
Line 1: 1 real number (rounded to 5 decimal places), the probability that the two towns chosen by Graff can be disconnected by the removal of any single road
Sample Input
4 4
1 2
1 3
2 4
4 1
Sample Output
0.50000
Explanation of Sample
The map of Feerie is illustrated below:
King Graff can make 6 possible choices as to where to place his
soldiers, and three of those (the three with one of the soldiers being
at town 3) result in defeat (if the road between towns 1 and 3 is
destroyed). The probability of failure is then
Comments