#C1940. Count of Participants per Problem
Count of Participants per Problem
Count of Participants per Problem
You are given a competition with M participants and K problems. For each problem, you are provided with a sequence of integers in which the first number P indicates the number of participants who solved that problem. This is followed by P participant identifiers (IDs) that solved it. Your task is to simply output the count P for each problem.
Note: The participant IDs are provided for informational purposes and do not affect the output. You only need to extract the count for each problem.
The input and output use standard input (stdin) and standard output (stdout) respectively.
inputFormat
The input consists of two lines:
- The first line contains two space-separated integers M and K, where M is the total number of participants and K is the number of problems.
- The second line contains a sequence of integers. For each of the K problems, the first integer is P (the number of participants who solved that problem), followed by P integers representing the participant IDs.
outputFormat
Output a single line containing K integers, separated by a space. Each integer represents the number of participants who solved the corresponding problem.
The answer should be printed to the standard output.
## sample5 3
2 1 2 3 2 3 4 1 5
2 3 1