시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB23111147.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.

예제 입력 1

6 2

예제 출력 1

1 4 5
2 3 6

예제 입력 2

12 3

예제 출력 2

1 7 12 6
10 3 9 4
5 2 8 11