시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 0 0 0 0.000%

문제

Alex organizes a chess tournament in his company. The tournament is a round-robin tournament of $n$ people, and each pair of players will face each other exactly once.

The problem is, there are only $k$ chess boards in the office ($k \le \frac{n}{2}$). So only $k$ games can be played at the same time. Let's call $g$ games, being simultaneously played by $2g$ distinct players, where $1 \le g \le k$, a round.

Your task is to help Alex to set a schedule with a minimal number of rounds.

입력

The input contains two integers $n$ and $k$ ($2 \le n \le 200, 1 \le k \le \frac{n}{2}$) --- the number of players and the number of chess boards.

출력

In the first line output an integer $r$ --- the number of rounds.

Then output $r$ sections, describing rounds. In the first line of each section, output an integer $g$ ($1 \le g \le k$) --- the number of games in this round. Then output $g$ lines with two integers each --- the pairs of players that will play in this round. All these $2g$ integers must be distinct integers from $1$ to $n$.

If there are several possible solutions, output any of them.

예제 입력 1

4 2

예제 출력 1

3
2
2 3
1 4
2
2 4
3 1
2
1 2
3 4

예제 입력 2

5 2

예제 출력 2

5
2
4 1
2 3
2
1 5
4 2
2
2 5
4 3
2
3 5
2 1
2
5 4
3 1

예제 입력 3

6 2

예제 출력 3

8
2
3 2
6 4
2
5 1
4 3
2
6 1
2 5
2
1 3
5 6
2
2 4
5 3
2
4 1
2 6
2
6 3
5 4
1
2 1