P7824 "RdOI R3" Poisoned Water.
Description
**This is an interactive IO problem.**
You have $n$ bottles of water in front of you, numbered from $1$ to $n$. Exactly $1$ bottle is poisoned. You can use some lab mice to determine which bottle is poisoned.
However, among the mice you find, **there is one and only one** **mutant mouse**. **If it drinks poisoned water, it will not die. Otherwise, it will die within $59$ seconds. All other mice will die within $59$ seconds if they drink poisoned water; otherwise, they will not die.**
You need to find the poisoned bottle within one minute. Since testing has already taken $59$ seconds, your program can only run for $1$ second.
### Interaction
First, read two integers $n$, $maxk$ from standard input, representing the number of water bottles and the maximum number of mice you are allowed to use.
If you need $k$ mice, print $k+1$ lines to standard output. Except for the last line, each line has the format: `1 m B1 B2 ... Bm`, meaning you take one mouse and let it drink the water from these $m$ bottles: bottle $B_1$, bottle $B_2$, $\cdots$, bottle $B_m$. Finally, print one line: `2`, then flush the output buffer, meaning you do not need more mice.
Below are buffer flushing operations for some languages:
- C++: `fflush(stdout)` or `cout.flush()`.
- C: `fflush(stdout)`.
- Java: `System.out.flush()`.
- Python: `stdout.flush()`.
- Pascal: `flush(output)`.
- Other languages: please refer to the documentation of the corresponding language.
Of course, if $k>maxk$, the interactor will return `WA`, `RE`, `UKE`, or `TLE`, and you will get $0$ points for that test.
Then read $k$ integers $R_1,R_2,\cdots,R_k$ from standard input, where $R_i\in\{0,1\}$. If $R_i=0$, it means the $i$-th mouse has died; otherwise, it means the $i$-th mouse is still alive.
Finally, print one integer to standard output, indicating the index of the poisoned bottle.
Input Format
See **Interaction**.
Output Format
See **Interaction**.
Explanation/Hint
### Sample Explanation
The poisoned bottle is $2$, and both the $2$-nd and the $10$-th times the mouse was made to drink bottle $2$, so the results returned for these two operations are $0$. For the other operations, since the mice did not drink the poisoned water, the returned result is $1$.
**The sample is only for understanding the interaction and may not be logically consistent.**
---
### Constraints
**This problem uses bundled tests.**
**Note: there is no subtask that contains all other subtasks.**
| subtask | score | $n$ | $maxk\ge$ |
| ------- | ----- | --------------- | --------- |
| $1$ | $1$ | $=1$ | $0$ |
| $2$ | $9$ | $\le 1000$ | $3000$ |
| $3$ | $20$ | $\le 1000$ | $30$ |
| $4$ | $30$ | $8\le n \le 16$ | $7$ |
| $5$ | $40$ | $\le 1000$ | $15$ |
---
### Notes
Only when you send operation `2` to the interactor will it tell you the answers to your previous operation `1`. In other words, you cannot get the return result immediately after performing a single operation `1`.
Translated by ChatGPT 5