HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Sorting and sequences > problem:


50753 - Average of the Nth Student

Guest
• Review clarifications (1)

Section problems

• 50358 - Series of Odd Numbers
• 50756 - Average of the Nth Student
• 50347 - Selling Oranges
• 50758 - National Elections - Revisited
• 50757 - National Elections - 1
• 50755- Top N Donors - 1
• 50290 - Minimax Sum
• 50339 - The Largest Rectangle
• 50753 - Average of the Nth Stu...
• 50735 - Top M Products
• 50361 - Align Two Lists

Feedback

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

Time limit 4500/4500/4500/4500 ms. Memory limit 110000/110000/110000/110000 Kb.
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


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

www.contester.ru