Output #2
Yes
...
In this case, as shown in below, the dungeon consists of two vertically adjacent rooms, there is a unique vertically passable door between them, and the left and right sides of both rooms have two entrance and exit doors, respectively, in total.
| |
-
| |
You use the magic first, and suppose that you choose the unique vertically passable door `- 1 1`. Then, no matter how DEGwer will choose doors, you can choose one from the remaining two entrance doors and one from the remaining two exit doors, which achieve your objective because the two rooms became connected by your first magic.
The following is an example of interactive inputs and outputs.
Input
Output
Explanation
`2 1 First`
An input is given.
`Yes`
As your objective is achievable, you print `Yes`.
`- 1 1`
You fix as open one that is $1$st from the top and $1$st from the left among the vertically passable door.
`| 1 2`
DEGwer fixes as closed one that is $1$st from the top and $2$nd from the left among the horizontally passable doors, i.e., the upper-right exit door.
`| 2 2`
You fix as open one that is $2$nd from the top and $2$nd from the left among the horizontally passable doors, i.e., the lower-right exit door.
`| 2 1`
DEGwer fixes as closed one that is $2$nd from the top and $1$st from the left among the horizontally passable doors, i.e., the lower-left entrance door.
`| 1 1`
You fix as open one that is $1$st from the top and $1$st from the left among the horizontally passable doors, i.e., the upper-left entrance door.
`a 0 0`
At this point, it is confirmed that the open lower-right exit door can be reached from the open upper-left entrance door, and your program must halt immediately after receiving the input indicating it.