LCC/Moose '19 Contest 4 J3 - Speedcubing

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 128M

Authors:
Problem type

Derek is at his first speedcubing competition, and he is participating in the "3x3 Average of Five" event. He has to solve the Rubik's cube 5 times, and his average time is the mean of the middle 3 times. This means the average excludes his best and worst solve times. There are N competitors at the event, including Derek. Can you figure out what place Derek is? Placement is determined as the number of competitor with an average solve time strictly less than his plus 1.

Input Specification

The first line of input with contain one integer, N (1 \le N \le 5000), the number of competitors in the event.

For each competitor, there will be 5 lines of input, their 5 solve times. These will be in seconds to exactly 2 decimal places, and no solve time will be greater than one minute (60 seconds) or less than 0.01 seconds.

Derek's solve times are listed first.

Output Specification

Output one integer, Derek's place relative to the other solvers' average of five.

Sample Input

3
19.23
21.10
22.90
16.78
24.02
33.21
28.41
29.10
25.32
30.01
12.21
15.02
11.92
11.20
13.54

Sample Output

2

Sample Explanation

Derek's average was 21.08, the other two contestant's averages were 29.17 and 12.56. This places him second of the three.


Comments

There are no comments at the moment.