当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5704:Luck Competition

题目描述
Participants of the Luck Competition choose a non-negative integer no more than 100 in their mind. After choosing their number, let $K$ be the average of all numbers, and $M$ be the result of $K\times \frac{2}{3}$. Then the lucky person is the one who choose the highest number no more than $M$. If there are several such people, the lucky person is chosen randomly.

If you are given a chance to know how many people are participating the competition and what their numbers are, calculate the highest number with the highest probability to win assuming that you're joining the competition.
输入解释
There are several test cases and the first line contains the number of test cases $T(T\leq10)$.

Each test case begins with an integer $N(1<N\leq100)$, denoting the number of participants. And next line contains $N-1$ numbers representing the numbers chosen by other participants.

输出解释
For each test case, output an integer which you have chosen and the probability of winning (round to two digits after the decimal point), seperated by space.

输入样例
3
4
1 2 3
4
1 1 2
4
20 30 40
输出样例
1 0.50
0 1.00
18 1.00
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5704

最后修改于 2020-10-25T23:24:57+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65535/32768K(Java/Others)