| Codeforces Round 1087 (Div. 2) |
|---|
| Finished |
This is an interactive problem.
You are given an integer $$$n$$$. There is a hidden array $$$a$$$ of length $$$2n$$$. Each integer from $$$1$$$ to $$$n$$$ appears exactly once in $$$a$$$. The rest of the elements are all $$$0$$$.
You can make the following type of query:
Find any integer $$$k$$$ ($$$1 \le k \le 2n$$$) such that $$$a_k=0$$$ in no more than $$$n+1$$$ queries. Note that the interactor is adaptive, which means that the hidden array $$$a$$$ may change depending on your queries but will not contradict previous queries.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^3$$$). The description of the test cases follows.
The first line of each test case contains an integer $$$n$$$ ($$$2 \le n \le 10^4$$$). The length of the hidden array $$$a$$$ will be $$$2n$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
To make a query, output a line in the following format:
As a response to the query, you will get:
To report the answer, output a line in the following format:
After this, proceed to the next test case or terminate if this is the last test case.
Note that reporting the answer does not count towards the $$$n+1$$$ queries.
The interactor is adaptive. This means that the hidden array $$$a$$$ may change depending on your queries but will not contradict previous queries.
After printing each query do not forget to output the end of line and flush$$$^{\text{∗}}$$$ the output. Otherwise, you will get Idleness limit exceeded verdict. If, at any interaction step, you read $$$-1$$$ instead of valid data, your solution must exit immediately. This means that your solution will receive Wrong answer because of an invalid query or any other mistake. Failing to exit can result in an arbitrary verdict because your solution will continue to read from a closed stream.
For this problem, hacks are disabled.
$$$^{\text{∗}}$$$To flush, use:
2 2 0 1 3 1 0 0
? 1 2 ? 3 1 ! 3 ? 5 6 ? 2 4 ? 1 3 ! 6
In the first example test case, the hidden array $$$a$$$ is $$$[0,1,0,2]$$$:
In the second example test case, the hidden array $$$a$$$ is $$$[3,2,0,1,0,0]$$$:
| Name |
|---|


