{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cp\u003eDoes there exist an undirected graph with \u003cvar\u003e\\(N\\)\u003c/var\u003e vertices satisfying the following conditions?\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eThe graph is simple and connected.\u003c/li\u003e\r\n\u003cli\u003eThe vertices are numbered \u003cvar\u003e\\(1, 2, ..., N\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003cli\u003eLet \u003cvar\u003e\\(M\\)\u003c/var\u003e be the number of edges in the graph. The edges are numbered \u003cvar\u003e\\(1, 2, ..., M\\)\u003c/var\u003e, the length of each edge is \u003cvar\u003e\\(1\\)\u003c/var\u003e, and Edge \u003cvar\u003e\\(i\\)\u003c/var\u003e connects Vertex \u003cvar\u003e\\(u_i\\)\u003c/var\u003e and Vertex \u003cvar\u003e\\(v_i\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003cli\u003eThere are exactly \u003cvar\u003e\\(K\\)\u003c/var\u003e pairs of vertices \u003cvar\u003e\\((i,\\ j)\\ (i \u0026lt; j)\\)\u003c/var\u003e such that the shortest distance between them is \u003cvar\u003e\\(2\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003eIf there exists such a graph, construct an example.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Constraints","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eAll values in input are integers.\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(2 \\leq N \\leq 100\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(0 \\leq K \\leq \\frac{N(N - 1)}{2}\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Input","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\r\n\u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e \u003cvar\u003e\\(K\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Output","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eIf there does not exist an undirected graph with \u003cvar\u003e\\(N\\)\u003c/var\u003e vertices satisfying the conditions, print \u003ccode\u003e-1\u003c/code\u003e.\u003c/p\u003e\r\n\u003cp\u003eIf there exists such a graph, print an example in the following format (refer to Problem Statement for what the symbols stand for):\u003c/p\u003e\r\n\u003cpre\u003e\u003cvar\u003e\\(M\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(u_1\\)\u003c/var\u003e \u003cvar\u003e\\(v_1\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(:\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(u_M\\)\u003c/var\u003e \u003cvar\u003e\\(v_M\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\r\n\u003cp\u003eIf there exist multiple graphs satisfying the conditions, any of them will be accepted.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n4 3\r\n1 2\r\n3 1\r\n4 5\r\n2 3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eThis graph has three pairs of vertices such that the shortest distance between them is \u003cvar\u003e\\(2\\)\u003c/var\u003e: \u003cvar\u003e\\((1,\\ 4)\\)\u003c/var\u003e, \u003cvar\u003e\\((2,\\ 4)\\)\u003c/var\u003e, and \u003cvar\u003e\\((3,\\ 5)\\)\u003c/var\u003e. Thus, the condition is satisfied.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 8\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eThere is no graph satisfying the conditions.\u003c/p\u003e\u003c/section\u003e\r\n"}}]}