AtCoder Grand Contest 040
F
Two Pieces
AtCoder
未评级
原题
← E→
翻译中…

Problem Statement

翻译中…

We have two indistinguishable pieces placed on a number line. Both pieces are initially at coordinate $0$. (They can occupy the same position.)

翻译中…

We can do the following two kinds of operations:

翻译中…
  • Choose a piece and move it to the right (the positive direction) by $1$.
  • Move the piece with the smaller coordinate to the position of the piece with the greater coordinate. If two pieces already occupy the same position, nothing happens, but it still counts as doing one operation.
翻译中…

We want to do a total of $N$ operations of these kinds in some order so that one of the pieces will be at coordinate $A$ and the other at coordinate $B$. Find the number of ways to move the pieces to achieve it. The answer can be enormous, so compute the count modulo $998244353$.

翻译中…

Two ways to move the pieces are considered different if and only if there exists an integer $i$ ($1 \leq i \leq N$) such that the set of the coordinates occupied by the pieces after the $i$-th operation is different in those two ways.

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 10^7$
  • $0 \leq A \leq B \leq N$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N A B

翻译中…

Output

翻译中…

Print the number of ways to move the pieces to achieve our objective, modulo $998244353$.

翻译中…

样例

Input #1
5 1 3
Output #1
4
Shown below are the four ways to move the pieces, where $(x,y)$ represents the state where the two pieces are at coordinates $x$ and $y$. - $(0,0)→(0,0)→(0,1)→(0,2)→(0,3)→(1,3)$ - $(0,0)→(0,0)→(0,1)→(0,2)→(1,2)→(1,3)$ - $(0,0)→(0,0)→(0,1)→(1,1)→(1,2)→(1,3)$ - $(0,0)→(0,1)→(1,1)→(1,1)→(1,2)→(1,3)$
Input #2
10 0 0
Output #2
1
Input #3
10 4 6
Output #3
197
Input #4
1000000 100000 200000
Output #4
758840509
题目信息
题号
agc040_f
时间限制
4 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。