|
Лимит времени 4500/4500/4500/4500 мс. Лимит памяти 110000/110000/110000/110000 Кб. Question by Ibrahim Mesecan.
Average of the Nth Student
Chinese Minister of Education is having a visit to your country.
He has heard that you have a nice program for schools.
And now, he is asking you to prepare something for their
their universtiy entrance exams.
Question: Write a program that
reads n students information (name, surname and an integer grade).
Then,using count sort, your program will sort students according to the averages in
descending order. And, it will show all students within the
range from a to b.
Input specification
The first line of the input contains three integers (n, a and b) where n denotes
the number of students and a nd b denotes the positions in the sorted list
where 0 ≤ a < b ≤ n ≤ 200000 (two hundred thousand). Each of the following n lines
will have semicolon separated information:
- Name and Surname: At most 36 chars string containing only English letters and space ending with a semicolon.
- Grade: an integer number between 0 and 10000
Output specification
Show all students from a to b with their names and grades.
Note:
- Please pay attention that there are two million names
thus, to avoid time limit, you can use count sort.
- Positions start from 0.
Sample Input I
10 1 4
Sherri Booker Haag; 5307
Branda Dell Large; 5976
Savannah Cecilia Mena; 5423
Glory Adam Newman; 9648
Sam Larson; 6079
Virgil Emmy Rico; 7221
Alexandra Cayla Frierson; 8307
Laraine Azucena Cook; 8426
Dalila Caroll Campbell; 7738
Margie Bowman; 8426
|
Sample Output I
Margie Bowman; 8426
Laraine Azucena Cook; 8426
Alexandra Cayla Frierson; 8307
Dalila Caroll Campbell; 7738
|
Для отправки решений необходимо выполнить вход.
|