#P7824. 「RdOI R3」毒水

「RdOI R3」毒水

Description

This is an interactive IO problem.

You have nn bottles of water in front of you, numbered from 11 to nn. Exactly 11 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 5959 seconds. All other mice will die within 5959 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 5959 seconds, your program can only run for 11 second.

Interaction

First, read two integers nn, maxkmaxk from standard input, representing the number of water bottles and the maximum number of mice you are allowed to use.

If you need kk mice, print k+1k+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 mm bottles: bottle B1B_1, bottle B2B_2, \cdots, bottle BmB_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>maxkk>maxk, the interactor will return WA, RE, UKE, or TLE, and you will get 00 points for that test.

Then read kk integers R1,R2,,RkR_1,R_2,\cdots,R_k from standard input, where Ri{0,1}R_i\in\{0,1\}. If Ri=0R_i=0, it means the ii-th mouse has died; otherwise, it means the ii-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.

4 12













1 0 1 1 1 1 1 1 1 0 1 1


1 1 1
1 1 2
1 1 3
1 1 4
1 1 1
1 1 2
1 1 3
1 1 4
1 1 1
1 1 2
1 1 3
1 1 4
2

2

Hint

Sample Explanation

The poisoned bottle is 22, and both the 22-nd and the 1010-th times the mouse was made to drink bottle 22, so the results returned for these two operations are 00. For the other operations, since the mice did not drink the poisoned water, the returned result is 11.

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 nn maxkmaxk\ge
11 =1=1 00
22 99 1000\le 1000 30003000
33 2020 3030
44 3030 8n168\le n \le 16 77
55 4040 1000\le 1000 1515

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