This page is still under construction.

Parts of this page are still being built. What you see may change.

Minions' Master

Time limit3sMemory limit256 MB

Summary
For each town, compute the average power and the percentage of residents above it, rounded to three decimals.
Level

Easy2 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

The minions go from town to town looking for a new master. Bob, who is far too eager, found a power meter in a cave. The meter shows the power of a person as a number. In each town the minions measure the power of every resident, then compute the average power of the town and the percentage of residents whose power is greater than that average.

For example, town A has 5 residents and the meter reads 50, 150, 70, 180, and 100. The average power is 110, and 2 residents have power greater than 110. The answer for that town is the average 110 and the percentage 40%.

Input

The first line contains the number of test cases TT (1≤T≤10001 \le T \le 1000). TT data sets follow. Each data set starts with the population NN of a town (1≤N≤10001 \le N \le 1000), followed by the powers of the NN residents separated by spaces. Each power is an integer between 0 and 1000.

Output

For each test case, print the average power and the percentage of residents whose power is greater than the average on one line. Separate the two values with a single space and put a percent sign after the percentage. Round both values to three decimal places and always print three digits after the decimal point.

Rounding follows the round half up rule: if the discarded part is exactly one half, round up. Many languages do not use this rule by default.

Examples1

  1. Example 1

    Input
    5
    5 50 50 70 80 100
    7 100 95 90 80 70 60 50
    3 70 90 80
    3 70 90 81
    10 1000 999 998 997 996 995 994 993 992 991
    
    Expected output
    70.000 40.000%
    77.857 57.143%
    80.000 33.333%
    80.333 66.667%
    995.500 50.000%