AtCoder Grand Contest 021
E
Ball Eat Chameleons
AtCoder
⌀ 3944
原题
← DF →
翻译中…

Problem Statement

翻译中…

In Republic of AtCoder, Snuke Chameleons (Family: Chamaeleonidae, Genus: Bartaberia) are very popular pets. Ringo keeps $N$ Snuke Chameleons in a cage.

翻译中…

A Snuke Chameleon that has not eaten anything is blue. It changes its color according to the following rules:

翻译中…
  • A Snuke Chameleon that is blue will change its color to red when the number of red balls it has eaten becomes strictly larger than the number of blue balls it has eaten.
  • A Snuke Chameleon that is red will change its color to blue when the number of blue balls it has eaten becomes strictly larger than the number of red balls it has eaten.
翻译中…

Initially, every Snuke Chameleon had not eaten anything. Ringo fed them by repeating the following process $K$ times:

翻译中…
  • Grab either a red ball or a blue ball.
  • Throw that ball into the cage. Then, one of the chameleons eats it.
翻译中…

After Ringo threw in $K$ balls, all the chameleons were red. We are interested in the possible ways Ringo could have thrown in $K$ balls. How many such ways are there? Find the count modulo $998244353$. Here, two ways to throw in balls are considered different when there exists $i$ such that the color of the ball that are thrown in the $i$-th throw is different.

翻译中…

Constraints

翻译中…
  • $1 \leq N,K \leq 5 \times 10^5$
  • $N$ and $K$ are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N K

翻译中…

Output

翻译中…

Print the possible ways Ringo could have thrown in $K$ balls, modulo $998244353$.

翻译中…

样例

Input #1
2 4
Output #1
7
We will use `R` to represent a red ball, and `B` to represent a blue ball. There are seven ways to throw in balls that satisfy the condition: `BRRR`, `RBRB`, `RBRR`, `RRBB`, `RRBR`, `RRRB` and `RRRR`.
Input #2
3 7
Output #2
57
Input #3
8 3
Output #3
0
Input #4
8 10
Output #4
46
Input #5
123456 234567
Output #5
857617983
题目信息
题号
agc021_e
时间限制
2 s
内存限制
256 MB

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