HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50569 - 12th Grade Elective Subjects

Guest
• Review clarifications (1)

Volume problems

• 50930 - Tom and Jerry
• 50925 - Optimizing Elevator Usage
• 50791 - Mine field
• Trip to Librazhd
• 50912 - Trip to Librazhd
• 50914 - Buy 3, Pay 2
• 50563 - Long Modulus
• 50565 - Binary numbers
• 50569 - 12th Grade Elective Sub...
• 50594 - Transformations
• 51182 - Count and Sum 2
• 51193 - The max element of k-th co...
• 51196 - The sum of two arrays
• 51197 - Even and odd Numbers
• Problem 3
• 50468 - Draw Matrix - 2
• 010. 50381 - Sum of the 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.

12th Grade Elective Subjects

Shqip

Question: Maturity exams for 12th grade students are organized by the ministry every year. The students are able to choose 3 subjects out of 20. Write a program that reads 3 choices of n students. And then, the program counts and shows course list with the number of students who has chosen that course.

Input specification
You will be first given the number of students an integer number (n) where 2 ≤ n ≤ 10,000. Then, in the following n lines, you will be given three course names where course names are one word strings containing only uppercase or lowercase English letters (no special characters).

Output specification
Show course list in ascending lexicographic order followed by the number of students taking that exam.

 Sample Input   
 4
 Biology Geography Sociology
 French Geography Psychology
 English History Physics
 French History Sociology
 Sample Output   
 Biology 1
 English 1
 French 2
 Geography 2
 History 2
 Physics 1
 Psychology 1
 Sociology 2


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

www.contester.ru