{"raw_statement":[{"iden":"statement","content":"*This is the easy version of the problem. The only difference is the maximum number of queries.*\n\n*This is an interactive problem.*\n\nThere is a secret permutation $p_0, p_1, \\\\dots, p_{n -1}$, which is a permutation of ${0, 1, \\\\dots, n -1}$. There is also a variable $m x$. At first, $m x = 4$.\n\nYour task is to guess the permutation by using queries of the following type:\n\nThe $\"mex\"(a)$ of an array $a$ is defined as the smallest non-negative integer that does not appear in $a$. For example, if $a = [ 0, 1, 2, 4 ]$, then $\"mex\"(a) = 3$ because $3$ is the smallest non-negative integer not present in $a$.\n\nFind out the secret permutation using at most $9 n + 1$ queries of the second type.\n\nEach test contains multiple test cases. The first line contains the number of test cases $t$ ($1 <= t <= 200$). The description of the test cases follows.\n\nThe first line of each test case contains one integer $n$ ($2 <= n <= 1024$). It is guaranteed that the sum of $n$ over all test cases will not exceed $1024$.\n\nAt this moment, the permutation $p_0, p_1, \\\\dots, p_{n -1}$ is chosen. The interactor in this task is *not adaptive*. In other words, the sequence $p$ is fixed in every test case and does not change during the interaction.\n\nThen you can make queries.\n\nTo make a query of the first type, output a line in the format \"! $i$ $v$\" (without quotes). Note that this line is *not* included in the count of $9 n + 1$ queries of the second type.\n\nTo make a query of the second type, output a line in the format \"? $k$ $j_1$ $j_2$ $\\\\dots$ $j_k$\" (without quotes) ($1 <= k <= n$, $0 <= j_i < n$). After each query, read an integer — the answer to your query.\n\nAfter performing $n$ queries of the first type (in other words, you have guessed the entire permutation $p$), if this is the last test case, the jury will terminate the program. Otherwise, the jury will output the next $n$.\n\nAfter printing each line, do not forget to output the end of line and flush the output buffer. Otherwise, you will receive the _Idleness limit exceeded verdict_. To flush, use:\n\nIn the first test case, the hidden permutation $p$ is $[ 2, 0, 1 ]$.\n\nFor the query \"_? 2 1 0_\", the jury returns $1$ because $min (m x, \"mex\"(p_1, p_0)) = min (4, 1) = 1$.\n\nThen, for answer \"_! 2 1_\", the jury increases $m x$ by $1$ since the answer is correct and you haven't answered for $p_2$ twice.\n\nFor the query \"_? 1 0_\", the jury returns $0$ because $min (m x, \"mex\"(p_0)) = min (5, 0) = 0$.\n\nNote queries are only for understanding statements and do *not* guarantee finding a unique permutation $p$.\n\n"},{"iden":"input","content":"Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 <= t <= 200$). The description of the test cases follows."},{"iden":"interaction","content":"The first line of each test case contains one integer $n$ ($2 <= n <= 1024$). It is guaranteed that the sum of $n$ over all test cases will not exceed $1024$.At this moment, the permutation $p_0, p_1, \\\\dots, p_{n -1}$ is chosen. The interactor in this task is *not adaptive*. In other words, the sequence $p$ is fixed in every test case and does not change during the interaction.Then you can make queries.To make a query of the first type, output a line in the format \"! $i$ $v$\" (without quotes). Note that this line is *not* included in the count of $9 n + 1$ queries of the second type.To make a query of the second type, output a line in the format \"? $k$ $j_1$ $j_2$ $\\\\dots$ $j_k$\" (without quotes) ($1 <= k <= n$, $0 <= j_i < n$). After each query, read an integer — the answer to your query.After performing $n$ queries of the first type (in other words, you have guessed the entire permutation $p$), if this is the last test case, the jury will terminate the program. Otherwise, the jury will output the next $n$.After printing each line, do not forget to output the end of line and flush the output buffer. Otherwise, you will receive the _Idleness limit exceeded verdict_. To flush, use:  _fflush(stdout)_ or _cout.flush()_ in C++;  _System.out.flush()_ in Java;  _stdout.flush()_ in Python;  see the documentation for other languages. "},{"iden":"note","content":"In the first test case, the hidden permutation $p$ is $[ 2, 0, 1 ]$.For the query \"_? 2 1 0_\", the jury returns $1$ because $min (m x, \"mex\"(p_1, p_0)) = min (4, 1) = 1$.Then, for answer \"_! 2 1_\", the jury increases $m x$ by $1$ since the answer is correct and you haven't answered for $p_2$ twice.For the query \"_? 1 0_\", the jury returns $0$ because $min (m x, \"mex\"(p_0)) = min (5, 0) = 0$.Note queries are only for understanding statements and do *not* guarantee finding a unique permutation $p$."}],"translated_statement":[{"iden":"statement","content":"*这是该问题的简单版本。两个版本之间的唯一区别在于查询中不同数字 $a$ 的数量限制。在本版本中，该限制不存在。*\n\n*这是一个交互式问题。*\n\n你和爱普丽尔·奥尼尔被困在巴克斯特·斯托克曼的实验室中。一群长着尖牙的老鼠夹正向你们逼近。唯一的逃生方法是猜出一个秘密密码——一个数字 $p$（$3 lt.eq p lt.eq 10^6$），用它来停用它们。爱普丽尔曾在此实验室工作，记得数字 $p$ 一定是 *质数*，因为最可靠的加密算法都使用质数。\n\n在老鼠夹的控制面板上，你们发现了一个漏洞。它允许你发出查询：“数字 $p$ 是否与 $d$ 模 $a$ 同余？”。换句话说：“$p - d$ 是否能被 $a$ 整除？”。你可以为每次查询自行指定 $a$ 和 $d$。\n\n如果你违反了交互格式，或进行了 *超过* $1000$ 次查询，老鼠夹的自毁协议将被触发，你将陷入危险。\n\n请帮助爱普丽尔破解控制面板并停用老鼠夹。\n\n你最多可以进行 *1000* 次查询，包括输出答案。\n\n交互器 *不是* 自适应的，即数字 $p$ 是固定的，且 *不会* 随查询改变。\n\n交互器接受如下格式的查询：\n\n在输出查询后，请务必输出换行符并刷新输出缓冲区。否则你将获得 “解决方案挂起” 的 verdict。如果你使用 _C++_，出题组建议不要启用输入/输出加速，并使用 _std::endl_ 作为换行符。\n\n交互器将返回一个数字作为响应：\n\n当你准备好说出数字 $p$（$3 lt.eq p lt.eq 10^6$）时，请以如下格式输出：\n\n在输出秘密密码后，你的程序必须立即终止，否则出题组不保证 verdict 的正确性。\n"},{"iden":"протокол взаимодействия","content":"你最多可以进行 *1000* 次查询，包括输出答案。交互器 *不是* 自适应的，即数字 $p$ 是固定的，且 *不会* 随查询改变。交互器接受如下格式的查询：\n\n_?_ $a$ $d$（$2 lt.eq a lt.eq 2 dot.op 10^6$，$0 lt.eq d < a$）\n\n在输出查询后，请务必输出换行符并刷新输出缓冲区。否则你将获得 “解决方案挂起” 的 verdict。如果你使用 _C++_，出题组建议不要启用输入/输出加速，并使用 _std::endl_ 作为换行符。\n\n交互器将返回一个数字作为响应：\n\n$0$，表示数字 $p$ *不* 与 $d$ 模 $a$ 同余；\n$1$，否则。\n\n当你准备好说出数字 $p$（$3 lt.eq p lt.eq 10^6$）时，请以如下格式输出：\n\n_!_ $p$\n\n在输出秘密密码后，你的程序必须立即终止，否则出题组不保证 verdict 的正确性。"},{"iden":"пример","content":"输入\n? 2 1\n\n? 3 1\n\n? 3 2\n\n! 3\n\n输出\n1\n\n0\n\n0\n"},{"iden":"примечание","content":"  "}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ p \\in \\mathbb{P} $ be the unknown prime such that $ 3 \\leq p \\leq 10^6 $.  \n\n**Constraints**  \n- You may make at most $ 1000 $ queries.  \n- Each query: choose integers $ a > 1 $, $ d $ with $ 0 \\leq d < a $, and ask whether $ p \\equiv d \\pmod{a} $.  \n- The interactor responds with $ 1 $ if $ p \\equiv d \\pmod{a} $, else $ 0 $.  \n\n**Objective**  \nIdentify $ p $ using at most $ 1000 $ adaptive queries of the form $ p \\stackrel{?}{\\equiv} d \\pmod{a} $.","simple_statement":null,"has_page_source":false}