3
499122178
499122178
499122178
Let us use `b` to represent a black square and `w` to represent a white square. There are eight possible boards: `www`, `wwb`, `wbw`, `wbb`, `bww`, `bwb`, `bbw`, and `bbb`, which are chosen with equal probability.
For each of these boards, there will be $0$, $1$, $0$, $2$, $1$, $3$, $2$, and $3$ black stones at the end of the game, respectively, regardless of the value of $s$. Thus, the expected number of stones is $(0+1+0+2+1+3+2+3)/8 = 3/2$, and the answer is $r = 499122178$, which satisfies $2r = 3 ~(\text{mod } 998244353)$ and $0 \leq r \lt 998244353$.10
5 5 992395270 953401350 735035398 735035398 953401350 992395270 5 5
19
499122186 499122186 499110762 499034602 498608106 496414698 485691370 434999274 201035754 138645483 201035754 434999274 485691370 496414698 498608106 499034602 499110762 499122186 499122186
{
"problem": {
"name": "1D Reversi Builder",
"description": {
"content": "Kuro and Shiro are playing with a board composed of $n$ squares lining up in a row. The squares are numbered $1$ to $n$ from left to right, and Square $s$ has a mark on it. First, for each square, Kur",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc109_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Kuro and Shiro are playing with a board composed of $n$ squares lining up in a row. The squares are numbered $1$ to $n$ from left to right, and Square $s$ has a mark on it.\nFirst, for each square, Kur...",
"is_translate": false,
"language": "English"
}
]
}