1466 - 「ZJOI2015」地震后的幻想乡

傲娇少女幽香是一个很萌很萌的妹子,而且她非常非常地有爱心,很喜欢为幻想乡的人们做一些自己力所能及的事情来帮助他们。

这不,幻想乡突然发生了地震,所有的道路都崩塌了。现在的首要任务是尽快让幻想乡的交通体系重新建立起来。幻想乡一共有 nnn 个地方,那么最快的方法当然是修复 n−1n-1n1 条道路将这 nnn 个地方都连接起来。 幻想乡这 nnn 个地方本来是连通的,一共有 mmm 条边。现在这 mmm 条边由于地震的关系,全部都毁坏掉了。每条边都有一个修复它需要花费的时间,第 iii 条边所需要的时间为 eie_iei。地震发生以后,由于幽香是一位人生经验丰富,见得多了的长者,她根据以前的经验,知道每次地震以后,每个 eie_iei 会是一个 000111 之间均匀分布的随机实数。并且所有 eie_iei 都是完全独立的。

现在幽香要出发去帮忙修复道路了,她可以使用一个神奇的大魔法,能够选择需要的那 n−1n-1n1 条边,同时开始修复,那么修复完成的时间就是这 n−1n-1n1 条边的 eie_iei 的最大值。当然幽香会先使用一个更加神奇的大魔法来观察出每条边 eie_iei 的值,然后再选择完成时间最小的方案。 幽香在走之前,她想知道修复完成的时间的期望是多少呢?

输入

第一行两个数 nmnmnm,表示地方的数量和边的数量。其中点从 111nnn 标号。

接下来 mmm 行,每行两个数 ababab,表示点 aaa 和点 bbb 之间原来有一条边。 这个图不会有重边和自环。

输出

一行输出答案,四舍五入保留6位小数。

样例

输入

5 4
1 2
1 5
4 3
5 3

输出

0.800000

提示

提示:
(以下内容与题意无关,对于解题也不是必要的。)
		对于 <span class="katex"><span class="katex-mathml">nn</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:0em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">n</span></span></span></span> 个 <span class="katex"><span class="katex-mathml">[0&#44;1][0&#44;1]</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.25em;"></span><span class="ba<x>se textstyle uncramped"><span class="mopen">[</span><span class="mord mathrm">0</span><span class="mpunct">&#44;</span><span class="mord mathrm">1</span><span class="mclose">]</span></span></span></span> 之间的随机变量 <span class="katex"><span class="katex-mathml">x1&#44;x2&#44;...&#44;xnx_1&#44;x_2&#44;...&#44;x_n</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.19444em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord"><span class="mord mathit">x</span><span class="vlist"><span><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;"></span></span><span class="reset-textstyle sc<x>riptstyle cramped"><span class="mord mathrm">1</span></span></span><span class="ba<x>seline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;"></span></span></span></span></span><span class="mpunct">&#44;</span><span class="mord"><span class="mord mathit">x</span><span class="vlist"><span><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;"></span></span><span class="reset-textstyle sc<x>riptstyle cramped"><span class="mord mathrm">2</span></span></span><span class="ba<x>seline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;"></span></span></span></span></span><span class="mpunct">&#44;</span><span class="mord mathrm">.</span><span class="mord mathrm">.</span><span class="mord mathrm">.</span><span class="mpunct">&#44;</span><span class="mord"><span class="mord mathit">x</span><span class="vlist"><span><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;"></span></span><span class="reset-textstyle sc<x>riptstyle cramped"><span class="mord mathit">n</span></span></span><span class="ba<x>seline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;"></span></span></span></span></span></span></span></span>,第 <span class="katex"><span class="katex-mathml">kk</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:0em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">k</span></span></span></span> 小的那个的期望值是 <span class="katex"><span class="katex-mathml">k/(n+1)k/(n+1)</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.25em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">k</span><span class="mord mathrm">/</span><span class="mopen">(</span><span class="mord mathit">n</span><span class="mbin">+</span><span class="mord mathrm">1</span><span class="mclose">)</span></span></span></span>。
	<br />
	
		数据范围:
	<br />
	
		对于所有数据:<span class="katex"><span class="katex-mathml">n≤10&#44;&nbsp;m≤n(n−1)/2&#44;&nbsp;n&#44;m≥1n \leq 10&#44; \ m \leq n(n-1)/2&#44; \ n&#44;m \geq 1</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.25em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">n</span><span class="mrel">≤</span><span class="mord mathrm">1</span><span class="mord mathrm">0</span><span class="mpunct">&#44;</span><span class="mord mspace"> </span><span class="mord mathit">m</span><span class="mrel">≤</span><span class="mord mathit">n</span><span class="mopen">(</span><span class="mord mathit">n</span><span class="mbin">−</span><span class="mord mathrm">1</span><span class="mclose">)</span><span class="mord mathrm">/</span><span class="mord mathrm">2</span><span class="mpunct">&#44;</span><span class="mord mspace"> </span><span class="mord mathit">n</span><span class="mpunct">&#44;</span><span class="mord mathit">m</span><span class="mrel">≥</span><span class="mord mathrm">1</span></span></span></span>。
	<br />
	
		对于 <span class="katex"><span class="katex-mathml">15%15 \%</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.05556em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathrm">1</span><span class="mord mathrm">5</span><span class="mord mathrm">%</span></span></span></span> 的数据:<span class="katex"><span class="katex-mathml">n≤3n \leq 3</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.13597em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">n</span><span class="mrel">≤</span><span class="mord mathrm">3</span></span></span></span>。
	<br />
	
		另有 <span class="katex"><span class="katex-mathml">15%15 \%</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.05556em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathrm">1</span><span class="mord mathrm">5</span><span class="mord mathrm">%</span></span></span></span> 的数据:<span class="katex"><span class="katex-mathml">n≤10&#44;m=nn \leq 10&#44; m=n</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.19444em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">n</span><span class="mrel">≤</span><span class="mord mathrm">1</span><span class="mord mathrm">0</span><span class="mpunct">&#44;</span><span class="mord mathit">m</span><span class="mrel">=</span><span class="mord mathit">n</span></span></span></span>。
	<br />
	
		另有 <span class="katex"><span class="katex-mathml">10%10 \%</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.05556em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathrm">1</span><span class="mord mathrm">0</span><span class="mord mathrm">%</span></span></span></span> 的数据:<span class="katex"><span class="katex-mathml">n≤10&#44;m=n(n−1)/2n \leq 10&#44; m=n(n-1)/2</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.25em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">n</span><span class="mrel">≤</span><span class="mord mathrm">1</span><span class="mord mathrm">0</span><span class="mpunct">&#44;</span><span class="mord mathit">m</span><span class="mrel">=</span><span class="mord mathit">n</span><span class="mopen">(</span><span class="mord mathit">n</span><span class="mbin">−</span><span class="mord mathrm">1</span><span class="mclose">)</span><span class="mord mathrm">/</span><span class="mord mathrm">2</span></span></span></span>。
	<br />
	
		另有 <span class="katex"><span class="katex-mathml">20%20 \%</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.05556em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathrm">2</span><span class="mord mathrm">0</span><span class="mord mathrm">%</span></span></span></span> 的数据:<span class="katex"><span class="katex-mathml">n≤5n \leq 5</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.13597em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">n</span><span class="mrel">≤</span><span class="mord mathrm">5</span></span></span></span>。
	<br />
	
		另有 <span class="katex"><span class="katex-mathml">20%20 \%</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.05556em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathrm">2</span><span class="mord mathrm">0</span><span class="mord mathrm">%</span></span></span></span> 的数据:<span class="katex"><span class="katex-mathml">n≤8n \leq 8</span><span class="katex-html"><span class="strut"></span><span class="strut bottom" style="vertical-align:-0.13597em;"></span><span class="ba<x>se textstyle uncramped"><span class="mord mathit">n</span><span class="mrel">≤</span><span class="mord mathrm">8</span></span></span></span>。
	<br />
</div>

来源

ZJOI2015 NOIP 省选 高级

时间限制 1 秒
内存限制 256 MB
讨论 统计
上一题 下一题