356. Rainfall Statistics
EasyAggregation
Given daily rainfall (mm), print the total, the average with two decimals, the 1-based day of maximum rainfall (first if tied) and the number of dry days (0 mm).
Input format
Line 1: n Line 2: n non-negative integers
Output format
total average maxDay dryDays
Example 1
Input
7 0 12 5 0 30 30 2
Output
79 11.29 5 2
Example 2
Input
1 0
Output
0 0.00 1 1
Constraints
1 ≤ n ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.
Loading the MyLoginn IDE…