HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50569 - 12th Grade Elective Subjects

Guest
• Review clarifications (1)

Volume problems

• 50912 - Trip to Librazhd
• Trip to Librazhd
• 50914 - Buy 3, Pay 2
• 50555 - Frequency of Letters
• 50558 - Biggest Barn
• 50563 - Long Modulus
• 50565 - Binary numbers
• 50567 - Input Data Normalization
• 50569 - 12th Grade Elective Sub...
• 50585 - Inner Product
• 50587 - Modular Conversion
• 50592 - Matrix Multiplication
• 50594 - Transformations
• 50653 - Long Divide
• 50767 - Censor
• 50768 - Where is Waldorf?
• 50792 - The student with the highest...

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