2 2 2 1 2 2 1
2 We have the following two ways. * First, move the rook from $(1, 2)$ to $(1, 1)$. Second, move it from $(1, 1)$ to $(2, 1)$. * First, move the rook from $(1, 2)$ to $(2, 2)$. Second, move it from $(2, 2)$ to $(2, 1)$.
1000000000 1000000000 1000000 1000000000 1000000000 1000000000 1000000000
24922282 Be sure to find the count modulo $998244353$.
3 3 3 1 3 3 3
9
{
"problem": {
"name": "Rook Path",
"description": {
"content": "There is a $H \\times W$\\-square grid with $H$ horizontal rows and $W$ vertical columns. Let $(i, j)$ denote the square at the $i$\\-th row from the top and $j$\\-th column from the left. The grid has a ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc232_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There is a $H \\times W$\\-square grid with $H$ horizontal rows and $W$ vertical columns. Let $(i, j)$ denote the square at the $i$\\-th row from the top and $j$\\-th column from the left.\nThe grid has a ...",
"is_translate": false,
"language": "English"
}
]
}