#AGC040F. [AGC040F] Two Pieces

    ID: 560 传统题 4000ms 1024MiB 尝试: 1 已通过: 1 难度: 7 上传者: 标签>数学组合数学排列组合二项式定理卡特兰数,Catalan生成函数,GF拉格朗日反演

[AGC040F] Two Pieces

Score : 22002200 points

Problem Statement

We have two indistinguishable pieces placed on a number line. Both pieces are initially at coordinate 00. (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 11.
  • 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 NN operations of these kinds in some order so that one of the pieces will be at coordinate AA and the other at coordinate BB. Find the number of ways to move the pieces to achieve it. The answer can be enormous, so compute the count modulo 998244353998244353.

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

Constraints

  • 1N1071 \leq N \leq 10^7
  • 0ABN0 \leq A \leq B \leq N
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN AA BB

Output

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

5 1 3
4

Shown below are the four ways to move the pieces, where (x,y)(x,y) represents the state where the two pieces are at coordinates xx and yy.

  • $(0,0) \to (0,0) \to (0,1) \to (0,2) \to (0,3) \to (1,3)$
  • $(0,0) \to (0,0) \to (0,1) \to (0,2) \to (1,2) \to (1,3)$
  • $(0,0) \to (0,0) \to (0,1) \to (1,1) \to (1,2) \to (1,3)$
  • $(0,0) \to (0,1) \to (1,1) \to (1,1) \to (1,2) \to (1,3)$
10 0 0
1
10 4 6
197
1000000 100000 200000
758840509