{"raw_statement":[{"iden":"problem statement","content":"Does there exist an undirected graph with $N$ vertices satisfying the following conditions?\n\n*   The graph is simple and connected.\n*   The vertices are numbered $1, 2, ..., N$.\n*   Let $M$ be the number of edges in the graph. The edges are numbered $1, 2, ..., M$, the length of each edge is $1$, and Edge $i$ connects Vertex $u_i$ and Vertex $v_i$.\n*   There are exactly $K$ pairs of vertices $(i,\\ j)\\ (i < j)$ such that the shortest distance between them is $2$.\n\nIf there exists such a graph, construct an example."},{"iden":"constraints","content":"*   All values in input are integers.\n*   $2 \\leq N \\leq 100$\n*   $0 \\leq K \\leq \\frac{N(N - 1)}{2}$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$"},{"iden":"sample input 1","content":"5 3"},{"iden":"sample output 1","content":"5\n4 3\n1 2\n3 1\n4 5\n2 3\n\nThis graph has three pairs of vertices such that the shortest distance between them is $2$: $(1,\\ 4)$, $(2,\\ 4)$, and $(3,\\ 5)$. Thus, the condition is satisfied."},{"iden":"sample input 2","content":"5 8"},{"iden":"sample output 2","content":"\\-1\n\nThere is no graph satisfying the conditions."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}