HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array_and_Matrices > problem:


50196 - Marathon

Volume problems

• 50180 - Min Distance
• 50181 - The biggest Minute
• 50185 - Word Puzzle
• 50188 - Swimming Contest
• 50189 - Top Question
• 50190 - Eight Puzzle
• 50191 - Number of Cities
• 50195 - Comparing Exams
• 50196 - Marathon
• 50205 - Secret Number
• 50206 - Club Presidency
• 50207 - Parking Place
• 50208 - Area of Triangle Revised
• 50209 - Number of Student Certificates
• 50210 - The largest Student Group
• 50212 - Buy the cheapest
• 50214 - Birthday Celebration

Feedback

If you notice incorrect translations in Contester, please let author know.

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.

Для отправки решений необходимо выполнить вход.

www.contester.ru