#C7042. Marathon Finishers Categorization

    ID: 50870 Type: Default 1000ms 256MiB

Marathon Finishers Categorization

Marathon Finishers Categorization

You are given the results of a marathon in which each participant's finish time is recorded. Your task is to categorize the finishers into three time brackets and report the count for each bracket.

The time brackets are defined as follows:

  • Less than 2 hours: For finish times strictly less than 2 hours.
  • 2 hours to 4 hours: For finish times between 2 and 4 hours (inclusive).
  • More than 4 hours: For finish times strictly greater than 4 hours.

The input starts with two numbers: the track length m (which is not used in the computation) and the number of participants n. The next line contains n floating-point numbers representing the finish times.

Your program should output three lines with the result counts for each time bracket in the order given above.

Mathematically, if we denote the finish times as \(t_i\) for \(i=1,\dots,n\), then the counts can be computed as:

\[ \text{count}_{<2} = \sum_{i=1}^{n} \mathbf{1}\{t_i 4} = \sum_{i=1}^{n} \mathbf{1}\{t_i > 4\}. \]

inputFormat

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

m n
finish_time[1] finish_time[2] ... finish_time[n]

Here, m is a floating-point number representing the track length (not used in the computation), n is an integer representing the number of participants, and each finish_time is a floating-point number.

outputFormat

The output should be written to stdout and consist of three lines exactly in the following format:

Less than 2 hours: X
2 hours to 4 hours: Y
More than 4 hours: Z

Where X, Y, and Z are the counts of participants in the respective time brackets.

## sample
10 5
1.5 3.2 4.5 2.9 1.8
Less than 2 hours: 2

2 hours to 4 hours: 2 More than 4 hours: 1

</p>