题目描述
Problem Description
X School is conducting internal training sessions for the upcoming CSP.
A total of $n$ OIers are participating in this training, and the coach has prepared $m$ sets of simulation contest problems for them.
However, each OIer has their own schedule, and it happens that each of them is available for exactly $m$ days out of the next $k$ days to participate in the simulation contests.
For ease of management, the coach stipulates that each person must complete the $m$ sets of simulation problems in order.
For example, if Xiao X is available on the 2nd, 3rd, and 5th days in the coming days, then he must complete the 1st set of problems on the 2nd day, the 2nd set on the 3rd day, and the 3rd set on the 5th day.
The coach needs to prepare for each person's simulation contest. To reduce the workload, if multiple people are doing the same set of problems on a given day, the coach only needs to prepare one session for that set of problems on that day.
As a master in the computer room, the coach asks you to help him calculate how many simulation contests he needs to prepare for each day.
Input Format
The first line contains three integers $n$, $m$, and $k$.
The next $n$ lines, each containing $m$ integers, where the $j$-th integer on the $i$-th line $a_{i,j}$ represents that the $i$-th person is available on the $a_{i,j}$-th day out of the next $k$ days for the $j$-th simulation contest.
Output Format
A single line with $k$ integers, where the $i$-th integer represents the number of simulation contests the coach needs to prepare for the $i$-th day.
Sample Input and Output
Sample Input #1
1 3 5
2 3 5
Sample Output #1
0 1 1 0 1
Sample Input #2
6 3 7
2 3 4
2 5 7
3 5 7
1 3 5
5 6 7
1 2 3
Sample Output #2
1 2 3 1 3 1 1
Sample Input #3
10 10 20
2 3 4 8 9 11 12 16 17 18
2 3 6 10 12 13 14 15 19 20
1 3 7 10 11 13 14 15 17 19
1 2 4 6 7 9 15 17 19 20
2 3 5 6 9 11 14 16 19 20
1 2 3 8 9 10 11 12 15 19
1 4 6 7 9 12 13 17 18 19
1 7 8 9 10 11 13 15 18 20
1 5 6 7 8 9 13 16 18 19
4 5 7 10 11 13 14 17 18 20
Sample Output #3
1 2 2 3 2 2 4 3 3 3 3 4 2 1 3 1 2 2 2 1
Notes
This problem uses batched testing.
- Subtask 1 (13 points): $n = m = k = 1$.
- Subtask 2 (24 points): $n = 1$.
- Subtask 3 (24 points): $m = 1$.
- Subtask 4 (39 points): No special restrictions.
For $100\%$ of the data, $1 \le n, m, k \le 10^3$, $m \le k$, $1 \le a_{i,1} < a_{i,2} < \cdots < a_{i,m} \le k$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分