HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


028. 50483 - Group Total

Guest
• Review clarifications (1)

Volume problems

• 020. 50408 - Molecules
• 022. 50366 - Student Averages (2 G...
• 023. 50437 - Age Labeling
• 024. 50372 - Number Quadruplets
• 025- 2013-Nov-01. 50328 - How far ...
• 026. 50399 - Mobile Base Station
• 026. 50487 - Radius of Inscribed Circle
• 027. 50548 - Albanian Airlines
• 028. 50483 - Group Total
• 030. 50584 - Total invoice amount
• 033. 50588 - Processing the list of n...
• 035. 50573 - Count and Sum
• 040. 50335 - Five Math Operators
• 044. 50597 - Drawing Diamonds
• 045. 50462 - Class Average (3 Gra...
• 050. 50450 - Last Appereance of a ...
• 058. 50574 - Triangular Numbers

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