Hamiltonian $k$-vertex-connected Graph

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

A graph (other than a complete graph) has connectivity kk if kk is the size of the smallest subset of vertices such that the graph becomes disconnected if you delete them.

A connected undirected graph GG is called Hamiltonian if it has a Hamiltonian cycle: a cycle that visits each vertex exactly once (except for the vertex that is both the start and the end, which is visited twice).

Bobo would like to construct a Hamiltonian graph with nn vertices which has connectivity kk. Also, the number of edges in the graph should be minimum possible.

입력

The first line contains two integers nn and kk where nn is the number of vertices in the graph (3n1003 \leq n \leq 100, 1kn21 \leq k \leq n - 2).

출력

If there is no such graph, output 1-1 on a single line. Otherwise, output an integer mm denoting the minimum number of edges. Then in each of the next mm lines, output two integers xx and yy (1x,yn1 \leq x, y \leq n, xyx \ne y) denoting an edge in the graph. In the following line, output a permutation of integers 1,2,,n1, 2, \ldots, n denoting a Hamiltonian cycle in the graph.