#K35567. Analyze Monthly Temperature Records
Analyze Monthly Temperature Records
Analyze Monthly Temperature Records
Given daily temperature records for a month, you are required to compute four values:
- The average temperature, calculated as \( \text{average} = \frac{\sum_{i=1}^{N} T_i}{N} \) and rounded to two decimal places.
- The highest temperature recorded.
- The lowest temperature recorded.
- The number of days for which the temperature is strictly above the average.
If no temperature records are given (i.e. when \( N = 0 \)), output all values as 0.
inputFormat
The input is given via standard input and consists of:
- An integer \( N \) on the first line representing the number of days.
- If \( N > 0 \), the second line contains \( N \) space-separated integers representing the temperatures recorded each day.
outputFormat
Output via standard output four values separated by a space in the following order:
- The average temperature (rounded to two decimal places).
- The highest temperature.
- The lowest temperature.
- The number of days with a temperature strictly above the average.
5
23 18 30 25 28
24.8 30 18 3