F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Luck Competition

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 3336    Accepted Submission(s): 1970


Problem Description
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.
 

Input
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.

 

Output
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.

 

Sample Input
3 4 1 2 3 4 1 1 2 4 20 30 40
 

Sample Output
1 0.50 0 1.00 18 1.00
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-19 08:34:06, Gzip enabled