P7998 [WFOI - 01] Guess the Number (guess)

Background

**This is an interactive problem. The interaction library is adaptive. Please note the special time limit.** **Remember to flush the output buffer after every output.** Simplified statement: [$\texttt{Link}$](https://www.luogu.com.cn/paste/xx7sa8go).

Description

You need to guess a positive integer $q$, and it is guaranteed that $q\in [1,n]$. Each time, you may make a query like `? x y`, and the interaction library will deliberately choose a number $z$ from $[x,y]$. Then the interaction library will output an answer in the form `u v`, meaning that the chosen number is $u$, and its relation to $q$ is $v$. Specifically: - When the library returns $v=0$, it means $uq$. The cost of one query is $\dfrac{1}{y-x+1}$. You can output what you believe is the correct answer using `! x`. Now you need to determine $q$. ------------ Let your total cost be $x$. The score you get on each test point depends on your total cost as follows (each test point has a full score of $10$ points): - If $x\le 1.9813035$, you can get $\text{10 pts}$. - If $1.9813035 < x \le 12$, you can get $\lfloor(12-x)\times0.7 \div 1.00186965\rfloor \text{ pts}$. - If $x\ge12$, you can get $\text{0 pts}$. Note that after every operation, you must call the following function to flush the buffer: - For C/C++: `fflush(stdout)`. - For C++: `std::cout

Input Format

See Interaction Format.

Output Format

See Interaction Format.

Explanation/Hint

- **Sample $1$ Explanation:** After querying, we find that $1