Minions’ Master (acm15s_minions)

Time limit:
3000 ms
Memory limit:
256 MB

The minions want to find their new master by travel to each town. The overly enthusiastic Bob found a power meter from one of the caves. The power meter can display the power of each human in the town. The minions use the power meter to measure the power of everyone in the town. Then, the average power of all people in that town and the percentage of people in the town with the power greater than the average power are calculated.

For example, Town A consists of 5 people. The power meter shows the following results: 50, 150, 70, 180, and 100. Thus, the average power is 110.  And, there are 2 people with the power greater than 110. Therefore, the answer is 110 40% where 110 is the average power and 40% is the percentage of people with the power greater than 110 (the average power). 


The first line of standard input contains an integer T, the number of test cases (1 <= T <= 1000). T data sets follow.  Each data set begins with an integer, N, the number of people in the town where 1 <= N <= 1000. N integers follow, separated by spaces, each giving the power of each person in the town (an integer between 0 and 1000). 


For each case you are to output a line giving the percentage of people whose power is greater than the average power, rounded to 3 decimal places. 


Source: ACM ICPC 2015 Thailand Local Southern

Select description language

English (raw)

If you don't find what you want

Translate it!

Edit this description