#K11001. Distribute Problems Among Teams
Distribute Problems Among Teams
Distribute Problems Among Teams
You are given N problems, which need to be distributed among M teams such that each team receives exactly K problems. The distribution is sequential, i.e., the first team gets the first K problems, the second team gets the next K problems, and so on.
The task is possible if and only if \( M \times K = N \). Otherwise, the output should be Impossible
.
Example:
Input: 10 2 5</p>Output: 1 2 3 4 5 6 7 8 9 10
inputFormat
The input consists of a single line containing three space-separated integers: N, M, and K, where:
- N is the total number of problems.
- M is the number of teams.
- K is the number of problems each team must solve.
You must read from stdin
.
outputFormat
If it is possible to distribute the problems (i.e. if \( M \times K = N \)), print the consecutive problems assigned to each team on a separate line, with the problem numbers separated by spaces. Otherwise, print Impossible
.
You must write the result to stdout
.
10 2 5
1 2 3 4 5
6 7 8 9 10
</p>