2 4 3 1 2 1 2 1 3
2 The process of handling the queries can be explained as follows: * In the 1st query, $(R_1, C_1) = (1, 2)$. There is a wall at $(1, 2)$, so the wall at $(1, 2)$ is destroyed. * In the 2nd query, $(R_2, C_2) = (1, 2)$. There is no wall at $(1, 2)$, so the walls at $(2,2),(1,1),(1,3)$, which are the first walls that appear when looking up, down, left, and right from $(1, 2)$, are destroyed. * In the 3rd query, $(R_3, C_3) = (1, 3)$. There is no wall at $(1, 3)$, so the walls at $(2,3),(1,4)$, which are the first walls that appear when looking up, down, left, and right from $(1, 3)$, are destroyed. After processing all queries, there are two remaining walls, at $(2, 1)$ and $(2, 4)$.
5 5 5 3 3 3 3 3 2 2 2 1 2
10
4 3 10 2 2 4 1 1 1 4 2 2 1 3 1 1 3 1 2 4 3 4 2
2
{
"problem": {
"name": "Cross Explosion",
"description": {
"content": "There is a grid with $H$ rows and $W$ columns. Let $(i, j)$ denote the cell at the $i$\\-th row from the top and $j$\\-th column from the left. Initially, there is one wall in each cell. After proce",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 4000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc370_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There is a grid with $H$ rows and $W$ columns. Let $(i, j)$ denote the cell at the $i$\\-th row from the top and $j$\\-th column from the left. \nInitially, there is one wall in each cell. \nAfter proce...",
"is_translate": false,
"language": "English"
}
]
}