Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Prepared by Ibrahim Mesecan.
Group Total
South-West Primary school is having a problem solving
competition. The contest is among the students of four
classes and every student
solves questions given in the book. The class with the most
number of questions solved will be the winner.
Question:
Input specification
Write a program that is going to read the information
for n students and find the winning class.
Input specification:
You will be given the number of students (n)
which is followed by 4 class names in the first line.
n is an integer between 1 and 1000
Each of the following n lines contain one student
information:
- Student Name: Not longer than 15 characters and containing
only uppercase or lowercase English letter.
- Class: Every class name consists of 3 to 5 characters.
They are composed of digits and uppercase English letters.
- Number of questions solved: An integer between 0 and 250
Output specification
Show the winning class with the total number of
questions solved by the students of this class.
Sample Input I |
Sample Output I |
8 08A 08B 08C 08D
Candace 08B 5
Viola 08A 8
Sidney 08D 2
Nicholas 08C 8
Holly 08A 5
Bryant 08B 5
Hugo 08D 5
Kristina 08C 10
|
08C 18
|
Для отправки решений необходимо выполнить вход.
|