Department Survey
Time limit1sMemory limit1024 MB
Given each club member's grade, class, and number, count members per major and count first-year students who have no major.
- Level
Easy1 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Students at Daegu Software Meister High School choose a different major starting in their second year, based on their career path.
- Software Development major: builds various software, such as front-end, back-end, and game development.
- Embedded Software Development major: develops software for embedded devices using Raspberry Pi, Arduino, and similar boards.
- Artificial Intelligence Software Development major: a new major opened last year, where students learn and develop AI.
To make students easier to manage, the school assigns Classes 1 and 2 to Software Development, Class 3 to Embedded Software Development, and Class 4 to Artificial Intelligence Software Development.
midori wants to find out how club members are distributed across majors.
Given the roster of club members, count how many belong to Software Development, Embedded Software Development, and Artificial Intelligence Software Development, and count how many first-year students cannot belong to any major.
Input
The first line contains the number of club members .
From the second line onward, the next lines each contain one student's grade , class , and number , separated by spaces. No two students share the same grade, class, and number.
All given numbers are integers.
Output
On the first line, print the number of students in the club who belong to Software Development.
On the second line, print the number of students in the club who belong to Embedded Software Development.
On the third line, print the number of students in the club who belong to Artificial Intelligence Software Development.
On the fourth line, print the number of first-year students in the club who do not belong to any major.