HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Non-linear Data structures: Map, Set, Priority Queues > problem:


50569 - 12th Grade Elective Subjects

Guest
• Review clarifications (1)

Section problems

• 50869 - Birthday Celebration
• 50981 - Top popular m-students
• 50794 - Writing Files Into HDD
• 51000 - Book Index
• 51024 - Total Stock Price
• 51023 - Preparing Keyword Index
• 50706 - The most crowded Club
• 50793 - Top M Customers
• 50569 - 12th Grade Elective Sub...
• Problem 3

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