Birthday Statistics
InterviewTime limit1sMemory limit128 MB
Count how many of the n employees were born in each month and print the twelve monthly totals.
- Level
Easy1 of 10
- Topics
- Array, Implementation
- Solved
- No attempts yet
Problem
A company collected the birth dates of all of its employees. Write a program that counts how many employees were born in each month.
Input
The first line contains the number of employees ().
Each of the next lines contains one employee's ID and that employee's birth date, separated by a space. The ID is a four-digit number, and the birth date is written as day/month/year.
Every date in the input is a real date.
Output
Print 12 lines, one for each month from 1 to 12 in that order. Each line contains the month number and the number of employees born in that month, separated by a space. A month with nobody born in it still gets a line, with the count 0.