| Baozii Cup 2 |
|---|
| Finished |
This is an interactive problem.
There is a hidden non-negative integer $$$n$$$ ($$$0 \le n \lt 2^{64}$$$). Your task is to determine $$$n$$$ by asking queries of the following type:
You may ask no more than $$$63$$$ queries.
Each test contains multiple test cases. The first line of each test contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases.
To ask a query, output a line in the following format:
where $$$x$$$ ($$$0 \le x \lt 2^{64}$$$) is the integer you asked.
After each query, you should read one line containing one integer, denoting the number of set bits of $$$n \oplus x$$$.
When you are ready to output the answer, output a line in the following format:
where $$$n$$$ ($$$0 \le n \lt 2^{64}$$$) is the hidden integer.
Note that printing the answer is not counted within the total number of queries.
The interactor is NOT adaptive, meaning that the answer is known before the participant asks the queries and does not depend on the queries asked by the participant.
After printing a query do not forget to output the end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:
1 2 13
? 0 ? 114514 ! 9
In the first test case, the hidden integer is $$$9$$$.
In the first query, $$$x=0$$$. The binary representation of $$$9 \oplus 0 = 9$$$ is $$$1001$$$, with $$$2$$$ set bits. The judge responds with $$$2$$$.
In the second query, $$$x=114514$$$. The binary representation of $$$9 \oplus 114514 = 114523$$$ is $$$11011111101011011$$$, with $$$13$$$ set bits. The judge responds with $$$13$$$.
| Name |
|---|


