Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Question by Ibrahim Mesecan.
Marathon
The organization committee of the marathon Istanbul invited you to
write the program to show top m runners.
Question:
Write a program that is going to read time information for
n-athletes and show the ids of top m athletes.
Input specification
In the first line, you will be given two
numbers (n and m). Then, in the following n
lines, you will be given 3 integers (hour minute
and seconds) where 0 ≤ m ≤ n ≤ 50,000
Output specification
Show m integers: ids of top m runners. If the times
are the same, show the athlete with a smaller id.
Sample Input I
5 3
23 45 58
2 7 3
11 1 20
1 36 3
11 47 4
|
Sample Input II
6 4
13 29 27
10 34 33
7 26 10
10 41 45
5 57 56
2 31 28
|
Sample Output I
4 2 3
|
Sample Output II
6 5 3 2
|
Explanation (for the first input):
The fourth athlete has completed the marathon the fastest
in 1 hour 36 minutes and 3 seconds. Then the second
athlete comes who has finished in 2 hours 7 minutes and
3 seconds. etc.
Для отправки решений необходимо выполнить вход.
|