#CCBCHBA0000124. Trung bình của nhiều dãy (Average of Several Number Lists)
Trung bình của nhiều dãy (Average of Several Number Lists)
Average of Several Number Lists
Source: Schaum’s Outline of Programming with C
Version: Phuoc Hung OJ Extended
Problem Statement
Given number lists, each with length and values , compute their arithmetic means in input order. Print one mean per line with exactly two decimal places. Round to the nearest hundredth, breaking exact ties away from zero. Print 0.00 for a result rounded to zero (no negative zero).
Input
The first line contains integer . Each of the next lines begins with integer , followed by exactly real values separated by one space. Each real value has at most two digits after the decimal point.
Output
Print exactly lines, one mean per list, with exactly two digits after the decimal point.
Subtasks
-
Subtask 1 (20%): ; per list; , at most two decimal digits.
-
Subtask 2 (30%): ; per list; , at most two decimal digits.
-
Subtask 3 (50%): ; per list; , at most two decimal digits.
Examples
Example 1
Input:
2
3
1 2 3
2
-0.25 0.25
Output:
2.00
0.00
Explanation:
Reset the sum for each list, divide by its length, and print the mean to two decimals.
Example 2
Input:
1
4
1.00 2.00 3.00 6.00
Output:
3.00
Explanation:
Reset the sum for each list, divide by its length, and print the mean to two decimals.