#C5917. Award Participants Based on Running Times

    ID: 49619 Type: Default 1000ms 256MiB

Award Participants Based on Running Times

Award Participants Based on Running Times

In this problem, you are given the running times of participants in a race. Your task is to assign awards based on their finish times. Only when there are at least 3 participants will awards be given. The procedure is as follows:

  1. If the number of participants (n) is less than 3, no awards are assigned (i.e. no output).
  2. Otherwise, sort the given times in ascending order.
  3. For the first 10 participants (or fewer if (n < 10)), assign awards based on the following distribution: (\bullet) The first 3 participants receive Gold medals. (\bullet) The next 2 participants receive Silver medals. (\bullet) The following 5 participants receive Bronze medals.

Each awarded participant's output consists of the time and the award, separated by a space.

Note: The input and output operations are performed via standard input (stdin) and standard output (stdout) respectively.

inputFormat

The input is read from standard input. The first line contains an integer (n) (the number of participants). Each of the next (n) lines contains a running time in the HH:MM:SS format. It is guaranteed that each time is a valid time string.

outputFormat

For participants (n \geq 3), output the awarded participants to standard output. Each line should contain the running time and its corresponding award (separated by a space) for the top (\min(n,10)) finishers after sorting the times in ascending order. If (n < 3), no output should be produced.## sample

7
02:45:30
03:30:10
02:10:20
01:22:30
02:50:10
01:45:50
03:10:00
01:22:30 Gold

01:45:50 Gold 02:10:20 Gold 02:45:30 Silver 02:50:10 Silver 03:10:00 Bronze 03:30:10 Bronze

</p>