No.2033 Chromatic Duel
タグ : / 解いたユーザー数 35
作問者 :
とりゐ
Problem Statement
There is a board with $N$ squares arranged in a horizontal row. Initially, nothing is placed on any square.
The first player and the second player perform the following operations on this board.
- The first player chooses $B$ distinct squares out of the $N$ squares and places $1$ black piece on each of them.
- The second player places white pieces on the board according to the rules below.
- The number of pieces placed on $1$ square, counting white and black pieces together, is at most $1$.
- White pieces must not be placed on a square horizontally adjacent to a square containing a black piece. Pieces of the same color may be adjacent to each other.
The maximum possible number of white pieces the second player can place depends on how the first player places the pieces.
There are $\dbinom{N}{B}$ ways for the first player to place the black pieces. Among them, how many are such that the maximum possible number of white pieces the second player can place is exactly $W$? Find this count modulo $998244353$.
Constraints
- All input values are integers.
- $3 \leq N \leq 2 \times 10^5$
- $1 \leq B$
- $0 \leq W$
- $B + W \leq N$
Input
The input is given from standard input in the following format.
$N$ $B$ $W$
Output
Print the answer, followed by a newline.
Sample
Sample 1
Input
4 1 1
Output
2
The $2$ ways are shown below. For each of them, the state of the board after both players' operations is shown. A square with a black piece is represented by x, and an empty square by ..
.x....x.
If the first player chooses the arrangement x..., the second player can place $2$ white pieces as in x.oo, which violates the condition of the problem.
Sample 2
Input
6 2 1
Output
6
The $6$ ways are shown below.
x..x...x.x..x...x...x.x..x...x..x..x
Sample 3
Input
5 3 0
Output
8
The $8$ ways are shown below.
xx.x.xx..xx.xx.x.x.xx..xx.xxx..xx.x.x.xx
Sample 4
Input
200000 123456 67890
Output
400954588
Print the answer modulo $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。