HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC-2014-15 Questions > problem:


1st-2. 50483 - Group Total

IMPC-2014-15 Questions

Start: Nov.22.2014 at 03:00:00 PM
Finish: Nov.22.2014 at 08:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 0th-1. 50402 - Hello World!
• 0th-2. 50403 - Number of Chairs
• 0th-3. 50763 - Valid Password
• 0th-4. 50404 - Sum of Self Powers
• 0th-5. 50692 - How much money?
• 1st-2. 50483 - Group Total
• 1st-3. 50484 - Number Of Letters
• 1st-4. 50473 - Counting Circles Posit...
• 1st-6. 50485 - Center of gravity of ...
• 2nd-1. 50522 - Multiplication Table - 2
• 2nd-2. 50512 - Coding redundancy
• 2nd-3. 50533 - Contacts List
• 2nd-5. 50793 - Top M Customers
• 2nd-6. 50486 - Problems and Progr...

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.
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:

  1. Student Name: Not longer than 15 characters and containing only uppercase or lowercase English letter.
  2. Class: Every class name consists of 3 to 5 characters. They are composed of digits and uppercase English letters.
  3. 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


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

www.contester.ru