#P5594. Coach's Simulation Contest Preparation

    ID: 18824 Type: Default 1000ms 256MiB

Coach's Simulation Contest Preparation

Coach's Simulation Contest Preparation

X School is holding an internal training session before the CSP. There are \( n \) OIers participating in this training and the coach has prepared \( m \) sets of simulation contest problems.

Each OIer has his/her own schedule. Coincidentally, over the next \( k \) days, every OIer is free on exactly \( m \) days to participate in these simulation contests. Furthermore, each OIer must take the \( m \) simulation contests in order. For example, if an OIer is free on days 2, 3, and 5, he/she must take the 1st contest on day 2, the 2nd on day 3, and the 3rd on day 5.

To ease the preparation burden, the coach only needs to prepare one contest per simulation problem on a particular day even if multiple OIers take the same contest (i.e. same contest index) on that day. Your task is to help calculate for each day, how many simulation contests (distinct contest indices) the coach needs to prepare.

Note: If on a certain day more than one OIer takes the same contest index, it is only counted once.

inputFormat

The first line contains three integers \( n \), \( m \), and \( k \) representing the number of OIers, the number of simulation contests, and the number of days respectively.

Then \( n \) lines follow. Each of these lines contains \( m \) distinct integers in strictly increasing order, indicating the days on which that OIer is free. The \( j^{th} \) number on a line represents the day the OIer takes the \( j^{th} \) simulation contest.

outputFormat

Output \( k \) integers separated by spaces. The \( i^{th} \) integer represents the number of simulation contests the coach has to prepare on day \( i \) (i.e. the number of distinct contest indices scheduled on that day).

sample

3 3 6
1 2 3
2 4 6
1 3 4
1 2 2 2 0 1