{"raw_statement":[{"iden":"problem statement","content":"We define the **density** of a non-empty simple undirected graph as $\\displaystyle\\frac{(\\text{number\\ of\\ edges})}{(\\text{number\\ of\\ vertices})}$.\nYou are given positive integers $N$ and $D$. Determine whether there is a simple undirected graph $G$ with $N$ vertices and $DN$ edges that satisfies the following condition. If it exists, find one such graph.\n**Condition:** Let $V$ be the vertex set of $G$. For any non-empty **proper** subset $X$ of $V$, the density of the induced subgraph of $G$ by $X$ is **strictly less than** $D$.\n\nWhat is an induced subgraph?\n\nFor a vertex subset $X$ of graph $G$, the **induced subgraph** of $G$ by $X$ is the graph with vertex set $X$ and edge set containing all edges of $G$ that connect two vertices in $X$. In the above condition, note that we only consider vertex subsets that are neither empty nor the entire set."},{"iden":"constraints","content":"*   $N \\geq 1$\n*   $D \\geq 1$\n*   $DN \\leq 5 \\times 10^4$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $D$"},{"iden":"sample input 1","content":"3 1"},{"iden":"sample output 1","content":"Yes\n1 2\n1 3\n2 3\n\nThe printed graph has vertex set ${1, 2, 3}$ and edge set ${(1, 2), (1, 3), (2, 3)}$, and is simple. The vertex set $X$ has $6$ non-empty proper subsets: ${1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}$.\n\n*   For $X = {1}, {2}, {3}$, the edge sets of the induced subgraphs by $X$ are empty, and the densities are $\\displaystyle\\frac{0}{1} = 0$.\n*   For $X = {1, 2}, {1, 3}, {2, 3}$, the edge sets of the induced subgraphs by $X$ are ${(1, 2)}, {(1, 3)}, {(2, 3)}$, respectively, and the densities are all $\\displaystyle\\frac{1}{2}$.\n\nIn all cases, the density of the induced subgraph is strictly less than $D = 1$, so this graph satisfies the condition."},{"iden":"sample input 2","content":"4 2"},{"iden":"sample output 2","content":"No\n\nA simple undirected graph with $4$ vertices and $8$ edges does not exist."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}