VK Cup 2022 - Финальный раунд (Engine)
F
Minimums or Medians
Codeforces
3400
原题
← E→
翻译中…

Vika has a set of all consecutive positive integers from $1$ to $2n$, inclusive.

翻译中…

Exactly $k$ times Vika will choose and perform one of the following two actions:

翻译中…
  • take two smallest integers from her current set and remove them;
  • take two median integers from her current set and remove them.
翻译中…

Recall that medians are the integers located exactly in the middle of the set if you write down its elements in increasing order. Note that Vika's set always has an even size, thus the pair of median integers is uniquely defined. For example, two median integers of the set $\{1, 5, 6, 10, 15, 16, 18, 23\}$ are $10$ and $15$.

翻译中…

How many different sets can Vika obtain in the end, after $k$ actions? Print this number modulo $998\,244\,353$. Two sets are considered different if some integer belongs to one of them but not to the other.

翻译中…

Input

翻译中…

The only line contains two integers $n$ and $k$ ($1 \le k \le n \le 10^6$).

翻译中…

Output

翻译中…

Print a single integer — the number of sets Vika can obtain in the end, modulo $998\,244\,353$.

翻译中…

Note

翻译中…

In the first example, Vika's initial set is $\{1, 2, 3, 4, 5, 6\}$. She can remove the minimums from it to obtain $\{3, 4, 5, 6\}$, or she can remove the medians from it to obtain $\{1, 2, 5, 6\}$.

翻译中…

In the second example, Vika can obtain $\{1, 6\}$, $\{3, 6\}$, or $\{5, 6\}$. For instance, Vika can obtain $\{3, 6\}$ if she removes two smallest integers first ($\{1, 2, 3, 4, 5, 6\} \rightarrow \{3, 4, 5, 6\}$), and then she removes two median integers ($\{3, 4, 5, 6\} \rightarrow \{3, 6\}$).

翻译中…

In the third example, regardless of Vika's choices, she'll end up with an empty set.

翻译中…

样例

Input #1
3 1
Output #1
2
InputCopy OutputCopy
Input #2
3 2
Output #2
3
InputCopy OutputCopy
Input #3
3 3
Output #3
1
InputCopy OutputCopy
Input #4
7 4
Output #4
11
InputCopy OutputCopy
Input #5
23 8
Output #5
88
InputCopy OutputCopy
Input #6
100 77
Output #6
825430474
InputCopy OutputCopy
题目信息
题号
1784F
时间限制
4 s
内存限制
512 MB

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