#P2550. [AHOI2001] 彩票摇奖
[AHOI2001] 彩票摇奖
Description
To enrich people's lives and support certain public welfare causes, Beita City has set up a lottery. The lottery rules are:
- Each ticket has distinct numbers, each in the range .
- Before claiming prizes, a winning set consisting of seven distinct numbers is announced each time.
- There are prize levels: Special Prize, and First Prize through Sixth Prize.
The prize-claiming rules are as follows:
- Special Prize: All numbers on the ticket appear in the winning set.
- First Prize: numbers on the ticket appear in the winning set.
- Second Prize: numbers on the ticket appear in the winning set.
- Third Prize: numbers on the ticket appear in the winning set.
- Fourth Prize: numbers on the ticket appear in the winning set.
- Fifth Prize: numbers on the ticket appear in the winning set.
- Sixth Prize: number on the ticket appears in the winning set.
Note: The positions of numbers on the ticket and in the winning set are not considered. For example, if the winning set is , then the ticket wins the Fifth Prize because two numbers ( and ) appear in the winning set.
Given the winning set and the numbers on several tickets bought by Xiao Ming, write a program to determine the prize results of Xiao Ming's tickets.
Input Format
The first line contains a single natural number , the number of tickets Xiao Ming bought.
The second line contains natural numbers between and , which are the winning numbers.
Each of the following lines contains natural numbers between and , representing each of Xiao Ming's tickets.
Output Format
Output the counts of Xiao Ming's winning tickets for each prize level, in order: first the number of Special Prize winners, then the counts for First Prize through Sixth Prize.
2
23 31 1 14 19 17 18
12 8 9 23 1 16 7
11 7 10 21 2 9 31
0 0 0 0 0 1 1
Hint
Constraints
For of the testdata, it is guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号