#C13856. Temperature Readings Analysis

    ID: 43440 Type: Default 1000ms 256MiB

Temperature Readings Analysis

Temperature Readings Analysis

You are given a series of temperature records for a number of days. Each record contains a day identifier and a temperature value. Some records may have missing or invalid temperature data. Your task is to determine the hottest day (i.e. the day with the maximum valid temperature), the coolest day (i.e. the day with the minimum valid temperature), and the average temperature computed over the valid records.

If no valid temperature readings exist, output None.

The average temperature is computed using the formula: \[ \text{average} = \frac{\sum_{i=1}^{n}{T_i}}{n} \] where \(T_i\) are the valid temperature readings and \(n\) is their count. Round the average to one decimal place.

inputFormat

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

  • The first line contains an integer N representing the number of records.
  • The next N lines each contain a day and its temperature separated by space. If the temperature value is invalid or missing, it will be represented by a string (for example, N/A, hot or None).

outputFormat

If there is at least one valid temperature reading, output three lines:

  1. Line 1: the day with the highest temperature (hottest day).
  2. Line 2: the day with the lowest temperature (coolest day).
  3. Line 3: the average temperature (rounded to one decimal place).

If there are no valid temperature readings, output a single line with None.

## sample
5
Monday 21.5
Tuesday 19.0
Wednesday 22.3
Thursday 16.8
Friday 18.4
Wednesday

Thursday 19.6

</p>