Spanning Trees

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

문제

Consider a complete graph with NN vertices. Find KK spanning trees that are edge-disjoint.

The leftmost figure above shows a complete graph with four vertices. The two figures to the right are two edge-disjoint spanning trees of this graph.

입력

You are given two integers NN and KK on a single line (2N1042 \le N \le 10^4, 1K1001 \le K \le 100).

출력

If there is no tuple of KK spanning trees that satisfies the conditions, print 1-1.

Otherwise, print KK spanning trees. Each spanning tree must be printed on N1N - 1 lines. The ii-th line must contain two space-separated integers: the two endpoints of the ii-th edge. The vertices are numbered 11 through NN. You may print an empty line between consecutive trees.