Codeforces Round 796 (Div. 1)
F
Koishi's Unconscious Permutation
Codeforces
3500
原题
← E→
翻译中…

As she closed the Satori's eye that could read minds, Koishi gained the ability to live in unconsciousness. Even she herself does not know what she is up to.— Subterranean Animism

翻译中…

Koishi is unconsciously permuting $n$ numbers: $1, 2, \ldots, n$.

翻译中…

She thinks the permutation $p$ is beautiful if $s=\sum\limits_{i=1}^{n-1} [p_i+1=p_{i+1}]$. $[x]$ equals to $1$ if $x$ holds, or $0$ otherwise.

翻译中…

For each $k\in[0,n-1]$, she wants to know the number of beautiful permutations of length $n$ satisfying $k=\sum\limits_{i=1}^{n-1}[p_i \lt p_{i+1}]$.

翻译中…

Input

翻译中…

There is one line containing two intergers $n$ ($1 \leq n \leq 250\,000$) and $s$ ($0 \leq s \lt n$).

翻译中…

Output

翻译中…

Print one line with $n$ intergers. The $i$-th integers represents the answer of $k=i-1$, modulo $998244353$.

翻译中…

Note

翻译中…

Let $f(p)=\sum\limits_{i=1}^{n-1}[p_i \lt p_{i+1}]$.

翻译中…

Testcase 1:

翻译中…

$[2,1]$ is the only beautiful permutation. And $f([2,1])=0$.

翻译中…

Testcase 2:

翻译中…

Beautiful permutations:

翻译中…

$[1,2,4,3]$, $[1,3,4,2]$, $[1,4,2,3]$, $[2,1,3,4]$, $[2,3,1,4]$, $[3,1,2,4]$, $[3,4,2,1]$, $[4,2,3,1]$, $[4,3,1,2]$. The first six of them satisfy $f(p)=2$, while others satisfy $f(p)=1$.

翻译中…

样例

Input #1
2 0
Output #1
1 0
InputCopy OutputCopy
Input #2
4 1
Output #2
0 3 6 0
InputCopy OutputCopy
Input #3
8 3
Output #3
0 0 0 35 770 980 70 0
InputCopy OutputCopy
题目信息
题号
1687F
时间限制
12 s
内存限制
1024 MB
标签
FFT
数学

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