#C1774. Organize Contests
Organize Contests
Organize Contests
You are given N participants, each with a unique registration number from 1 to N, and a maximum contest capacity C. Your task is to organize an online programming competition by distributing these participants into the minimum number of simultaneous contests. In each contest, the number of participants cannot exceed C.
The distribution should assign the participants in increasing order of their registration numbers. In other words, the first contest will consist of the first C participants (or fewer if N is smaller), the next contest will get the subsequent set, and so on.
Mathematically, if we let the number of contests be K, then we have:
Each contest output should first list the number of participants in that contest, followed by the list of participant registration numbers in that contest.
inputFormat
The input is given from standard input and consists of a single line containing two space-separated integers:
- N (1 ≤ N ≤ 105): the total number of participants.
- C (1 ≤ C ≤ N): the maximum capacity of each contest.
outputFormat
Print to standard output. The first line should contain an integer representing the minimal number of contests. Each of the following lines corresponds to one contest and starts with an integer indicating the number of participants in that contest, followed by the registration numbers of the participants in that contest, separated by spaces.
## sample10 3
4
3 1 2 3
3 4 5 6
3 7 8 9
1 10
</p>