問題一覧 > 通常問題

No.2299 Antitypoglycemia

レベル : / AI推定難易度 : 500 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 188
作問者 : Shirotsume / テスター : ygussany yassu0320
お気に入りにしたユーザー ProblemId : 9292 / 自分の提出
問題文最終更新日: 2023-05-03 01:29:29
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 388 (順位表) の他の問題:

Problem Statement

There is a sequence $P = (P_1, P_2, \dots, P_N)$ that is a permutation of $(1, 2, \dots, N)$.

You have forgotten $P$, but you remember only that the first term $P_1$ was not $A$ and the last term $P_N$ was not $B$.

Assuming this memory is correct, find the number of possible sequences $P$, modulo $998244353$.

Constraints

  • All input values are integers.
  • $2 \leq N \leq 2 \times 10^5$
  • $1 \leq A, B \leq N$

Input

The input is given from standard input in the following format.

$N$ $A$ $B$

Output

Output the number of possible sequences $P$, modulo $998244353$.

Sample

Sample 1
Input
3 1 2
Output
3

The permutations of $(1, 2, 3)$ whose first term is not $1$ and whose last term is not $2$ are the following $3$: $(2, 1, 3)$, $(2, 3, 1)$, and $(3, 2, 1)$.

Sample 2
Input
3 1 1
Output
2

The permutations of $(1, 2, 3)$ whose first term is not $1$ and whose last term is not $1$ are the following $2$: $(2, 1, 3)$ and $(3, 1, 2)$.

Sample 3
Input
100 75 43
Output
292028703

Do not forget to output the result modulo $998244353$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。