{"problem":{"name":"Friendships","description":{"content":"Does there exist an undirected graph with $N$ vertices satisfying the following conditions? *   The graph is simple and connected. *   The vertices are numbered $1, 2, ..., N$. *   Let $M$ be the num","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc131_e"},"statements":[{"statement_type":"Markdown","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.\n\n## Constraints\n\n*   All values in input are integers.\n*   $2 \\leq N \\leq 100$\n*   $0 \\leq K \\leq \\frac{N(N - 1)}{2}$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc131_e","tags":[],"sample_group":[["5 3","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."],["5 8","\\-1\n\nThere is no graph satisfying the conditions."]],"created_at":"2026-03-03 11:01:13"}}