|
Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Student Groups
For a contest, organization committee wants to
form k equal level groups. For this,
they are putting the students in descending order
according to the points they have collected. And then,
first student goes to the first
group and the second student goes to the second
group, ... and kth student is placed to the kth group.
Then (k+1)th student is again placed into the first
group, and so on.
Question:
Write a program that is going to read student
information. Then, your program will print the people
in mth group.
Input specification
You will be given three integers in the first line:
- the number students (n)
- the number of groups (k)
- the group to be printed (m)
where 0 ≤ n ≤ 2000, 1 ≤ k ≤ 20
and 1 ≤ m ≤ k. Then, in the following n lines
you will be given name and average of n people.
A student is before the other, if he has higher points
than the other. If two students have the same
points collected, the student whose name
alphabetically smaller comes the first. Student
points are integers between 1 and 10,000.
Output specification
Show the names of the people in group m.
Sample Input I
6 3 2
Endri 7
Andi 4
Albi 5
Genti 6
Evis 6
Denis 8
|
Sample Output I
Endri
Albi
|
Explanation:
There are three goups.
- The first group will have Denis Genti.
- The second group will have Endri Albi.
- The third group will have Evis Andi.
Для отправки решений необходимо выполнить вход.
|