Problem E1

Statement
Copy Copied
Description:
This is the easy version of the problem. The only difference is the limit on the number of queries.

This is an interactive problem.

You are given a tree of $$$n$$$ nodes with node $$$1$$$ as its root node.

There is a hidden mole in one of the nodes. To find its position, you can pick an integer $$$x$$$ ($$$1 \le x \le n$$$) to make an inquiry to the jury. Next, the jury will return $$$1$$$ when the mole is in subtree $$$x$$$. Otherwise, the judge will return $$$0$$$. If the judge returns $$$0$$$ and the mole is not in root node $$$1$$$, the mole will move to the parent node of the node it is currently on.

Use at most $$$300$$$ operations to find the current node where the mole is located.

Input Format:
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). The description of the test cases follows.

Output Format:
None

Note:
In the first test case, the mole is in node $$$2$$$ initially.

For the query "? 2", the jury returns $$$1$$$ because the mole is in subtree $$$2$$$. After this query, the mole does not move.

The answer $$$2$$$ is the current node where the mole is located, so the answer is considered correct.

In the second test case, the mole is in node $$$6$$$ initially.

For the query "? 2", the jury returns $$$0$$$ because the mole is not in subtree $$$2$$$. After this query, the mole moves from node $$$6$$$ to node $$$5$$$.

For the query "? 6", the jury returns $$$0$$$ because the mole is not in subtree $$$6$$$. After this query, the mole moves from node $$$5$$$ to node $$$4$$$.

For the query "? 4", the jury returns $$$1$$$ because the mole is in subtree $$$4$$$. After this query, the mole does not move.

The answer $$$4$$$ is the current node where the mole is located, so the answer is considered correct.

Please note that the example is only for understanding the statement, and the queries in the example do not guarantee to determine the unique position of the mole.