5 .#... .#.#. ...#. 3 1 2 1 2 2 3
6 10 -1 In the first query, flip the state of cell $(1,2)$. As a result, the state of each cell becomes: ..... .#.#. ...#. At this time, by moving from cell $(1,1)$ through cells $(1,2),(1,3),(1,4),(1,5),(2,5),(3,5)$ in order, you can reach cell $(3,5)$ in six moves. In the second query, flip the state of cell $(1,2)$. As a result, the state of each cell becomes: .#... .#.#. ...#. At this time, by moving from cell $(1,1)$ through cells $(2,1),(3,1),(3,2),(3,3),(2,3),(1,3),(1,4),(1,5),(2,5),(3,5)$ in order, you can reach cell $(3,5)$ in ten moves. In the third query, flip the state of cell $(2,3)$. As a result, the state of each cell becomes: .#... .###. ...#. At this time, no matter how you move, you cannot reach cell $(3,5)$ from cell $(1,1)$.
7 .#..... .#..#.. ...#... 6 2 5 3 4 3 5 2 5 1 4 1 4
10 8 10 12 -1 12
{
"problem": {
"name": "Shortest Path Query",
"description": {
"content": "You are given a grid with three rows and $N$ columns. Denote the cell at the $i$\\-th row from the top and $j$\\-th column from the left as cell $(i,j)$. Cell $(i,j)$ is a wall cell if $S_{i,j}$ is `#`,",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 4000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc429_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a grid with three rows and $N$ columns. Denote the cell at the $i$\\-th row from the top and $j$\\-th column from the left as cell $(i,j)$. Cell $(i,j)$ is a wall cell if $S_{i,j}$ is `#`,...",
"is_translate": false,
"language": "English"
}
]
}