#C8289. Total and Average Rainfall Calculation

    ID: 52254 Type: Default 1000ms 256MiB

Total and Average Rainfall Calculation

Total and Average Rainfall Calculation

You are given several test cases. For each test case, you are given the number of days and the rainfalls for those days. Your task is to calculate the total rainfall and the average daily rainfall for each test case.

The average daily rainfall is computed using the formula:

$$ \text{Average} = \frac{\text{Total Rainfall}}{N} $$

where \(N\) is the number of days. The calculated average must be rounded to two decimal places.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains an integer \(T\), the number of test cases.
  • For each test case, the first line contains an integer \(N\) representing the number of days.
  • The second line contains \(N\) space-separated integers, each representing the rainfall on a day.

outputFormat

For each test case, output a single line to standard output (stdout) containing two values separated by a space:

  • The total rainfall (an integer).
  • The average daily rainfall (a floating-point number rounded to two decimal places).
## sample
3
5
10 20 30 40 50
4
25 35 45 55
3
2 4 6
150 30.00

160 40.00 12 4.00

</p>