{"raw_statement":[{"iden":"problem statement","content":"You are given positive integers $M,K$.\nDetermine whether there exist a positive integer $N$ and an integer sequence $A=(A_1,A_2,\\ldots, A_N)$ that satisfy all the following conditions, and if they exist, find one.\n\n*   $1\\le N\\le M$\n*   $0\\le A_i < M$ $(1\\le i\\le N)$\n*   There are exactly $K$ integers $0\\le k < M$ such that there exists a pair of indices $(i,j)$ satisfying $k\\equiv A_i+A_j \\pmod M$.\n\nYou are given $T$ test cases, so find the answer for each."},{"iden":"constraints","content":"*   $1\\le T\\le 2\\times 10^5$\n*   $1\\le K\\le M\\le 2\\times 10^5$\n*   The sum of $M$ over all test cases is at most $2\\times 10^5$.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\text{case}_2$\n$\\vdots$\n$\\text{case}_T$\n\nEach test case is given in the following format:\n\n$M$ $K$"},{"iden":"sample input 1","content":"3\n6 5\n3 2\n8 3"},{"iden":"sample output 1","content":"Yes\n3\n3 1 4\nNo\nYes\n2\n0 1\n\nFor the first test case, if we set $A=(3,1,4)$, then\n\n*   $k=0$: Setting $(i,j)=(1,1)$, we have $0\\equiv 3+3\\pmod 6$.\n*   $k=1$: Setting $(i,j)=(1,3)$, we have $1\\equiv 3+4\\pmod 6$.\n*   $k=2$: Setting $(i,j)=(3,3)$, we have $2\\equiv 4+4\\pmod 6$.\n*   $k=3$: There is no pair of indices $(i,j)$ that satisfies the condition.\n*   $k=4$: Setting $(i,j)=(1,2)$, we have $4\\equiv 3+1\\pmod 6$.\n*   $k=5$: Setting $(i,j)=(2,3)$, we have $5\\equiv 1+4\\pmod 6$.\n\nThus, there are exactly $5$ values of $0\\le k < 6$ that satisfy the condition."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}