{"problem":{"name":"Adjacent Replace","description":{"content":"You are given a sequence of non-negative integers of length $N$: $A=(A_1,A_2,\\ldots,A_N)$ and a non-negative integer $K$. Determine whether it is possible to make $A_1=K$ by performing the following o","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc199_b"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of non-negative integers of length $N$: $A=(A_1,A_2,\\ldots,A_N)$ and a non-negative integer $K$.\nDetermine whether it is possible to make $A_1=K$ by performing the following operation at most $10^4$ times:\n\n*   Choose an integer $i\\ (1\\leq i\\leq N-1)$. Let $x=A_i\\oplus A_{i+1}$, then replace both $A_i,A_{i+1}$ with $x$.\n\nHere, $\\oplus$ denotes the bitwise XOR operation.\nIf possible, output one such sequence of operations.\nYou are given $T$ test cases, so solve each of them.\nWhat is bitwise XOR operation?The bitwise XOR of non-negative integers $A, B$, denoted $A \\oplus B$, is defined as follows:\n\n*   When $A \\oplus B$ is written in binary, the digit in the $2^k$ ($k \\geq 0$) place is $1$ if exactly one of $A, B$ has $1$ in the $2^k$ place when written in binary, and $0$ otherwise.\n\nFor example, $3 \\oplus 5 = 6$ (in binary: $011 \\oplus 101 = 110$).\n\n## Constraints\n\n*   $1\\leq T\\leq 50$\n*   $3\\leq N\\leq 60$\n*   $0\\leq A_i,K\\lt 2^{60}$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\mathrm{case}_1$\n$\\mathrm{case}_2$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach test case is given in the following format:\n\n$N$ $K$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc199_b","tags":[],"sample_group":[["5\n3 5\n2 3 4\n3 0\n2 3 4\n3 8\n2 3 4\n3 2\n2 3 4\n4 10\n2 3 4 8","Yes\n2\n2 1\nYes\n3\n1 1 1\nNo\nYes\n0\n\nYes\n4\n2 3 2 1\n\nFor the first test case, you can make $A_1=5$ by performing the operations as follows:\n\n1.  Choose $i=2$. $A$ becomes $(2,7,7)$.\n2.  Choose $i=1$. $A$ becomes $(5,5,7)$.\n\nFor the second test case, you can make $A_1=0$ by performing the operations as follows:\n\n1.  Choose $i=1$. $A$ becomes $(1,1,4)$.\n2.  Choose $i=1$. $A$ becomes $(0,0,4)$.\n3.  Choose $i=1$. $A$ becomes $(0,0,4)$.\n\nFor the third test case, it is impossible to make $A_1=8$ with at most $10^4$ operations."]],"created_at":"2026-03-03 11:01:13"}}