#C7992. Dormitory Assignment Problem
Dormitory Assignment Problem
Dormitory Assignment Problem
Given n students, m dormitories, and a capacity c for each group within a dormitory, your task is to assign each student to a dormitory. The assignment is done in order according to the formula:
$$ \text{dormitory} = \left( \frac{i}{c} \right) \bmod m + 1 $$
Here, \(i\) is the 0-indexed position of the student. After every \(m\) dormitories, the assignment wraps around.
For example, if \(n=7\), \(m=3\), and \(c=2\), the dormitory assignment would be: [1, 1, 2, 2, 3, 3, 1].
inputFormat
The input is given via standard input and consists of three integers (n), (m), and (c) separated by spaces. (n) is the number of students, (m) is the number of dormitories, and (c) is the capacity per group in each dormitory.
outputFormat
Output the dormitory assignments for all (n) students as a sequence of integers separated by a single space. The result should be printed to standard output.## sample
7 3 2
1 1 2 2 3 3 1