#P3343. [ZJOI2015] 地震后的幻想乡
[ZJOI2015] 地震后的幻想乡
Description
The tsundere girl Yuuka is very cute and very kind, and she likes to help the people of Gensokyo with what she can.
An earthquake suddenly struck Gensokyo, and all the roads collapsed. The top priority now is to reestablish the transportation network as soon as possible. There are places in total, and the fastest way is of course to repair roads to connect all places. Originally, these places formed a connected graph with edges. Due to the earthquake, all edges were destroyed. Each edge has a repair time; the -th edge requires time . Based on past experience, Yuuka knows that after each earthquake, every is an independent random real number uniformly distributed in , and all are mutually independent.
Yuuka is going to help repair the roads. She can use a magical spell to select the required edges and start repairing them simultaneously; the completion time is then the maximum of the on those edges. Of course, Yuuka will first use an even more magical spell to observe the value of each , and then choose the plan that minimizes the completion time. Before she leaves, she wants to know the expected value of the completion time.
Input Format
The first line contains two integers , the number of places and the number of edges. The vertices are labeled from to .
The next lines each contain two integers , indicating that there was originally an edge between vertices and . The graph has no multiple edges or self-loops.
Output Format
Output one line with the answer, rounded to decimal places.
5 4
1 2
1 5
4 3
5 3
0.800000
Hint
Sample Explanation
For the first sample, since there are only four edges, Yuuka can only choose these four. The answer is the expectation of the maximum among the four . As noted in the hint below, the answer is .
Hint
(The following content is unrelated to the problem and is not necessary for solving it.)
For random variables uniformly distributed in , the expected value of the -th smallest is .
Constraints:
For all testdata: , , .
For of the testdata: .
Additionally, for of the testdata: , .
Additionally, for of the testdata: , .
Additionally, for of the testdata: .
Additionally, for of the testdata: .
Translated by ChatGPT 5
京公网安备 11011102002149号