| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 23 | 11 | 11 | 47.826% |
Consider the set of all integers from 1ドル$ to $n$. Split these integers into $k$ equal-sized groups in such a way that the difference between the maximum and minimum sums of integers among all groups is minimized. Formally, if $s_i$ is the sum of integers in $i$-th group, the following value should be minimized:
$$\max\limits_{i=1}^k s_i - \min\limits_{i=1}^k s_i\text{.}$$
The first line contains two integers $n$ and $k$ (1ドル \leq n, k \leq 100,000円$; $n$ is divisible by $k$).
For each group, print a line with all the integers belonging to that group. If there are multiple optimal answers, output any one of them.
6 2
1 4 5 2 3 6
12 3
1 7 12 6 10 3 9 4 5 2 8 11