AtCoder Regular Contest 140
F
ABS Permutation (Count ver.)
AtCoder
⌀ 3392
原题
← E→
翻译中…

Problem Statement

翻译中…

Find the number of permutations $P=(P_1,P_2,\dots,P_N)$ of $(1,2,\dots,N)$ that satisfy the following, modulo $998244353$, for each $K=0,1,2,\dots,N-1$.

翻译中…
  • There are exactly $K$ integers $i$ such that $1 \le i \le N-1$ and $|P_i - P_{i+1}|=M$.
翻译中…

Constraints

翻译中…
  • $2 \le N \le 250000$
  • $1 \le M \le N-1$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M

翻译中…

Output

翻译中…

Print the number of permutations that satisfy the condition, modulo $998244353$, for each $K=0,1,2,\dots,N-1$.

翻译中…

样例

Input #1
3 1
Output #1
0 4 2
- For $K=0$, the condition is satisfied by no permutations $P$. - For $K=1$, the condition is satisfied by four permutations $P$: $(1,3,2),(2,1,3),(2,3,1),(3,1,2)$. - For $K=2$, the condition is satisfied by two permutations $P$: $(1,2,3),(3,2,1)$.
Input #2
4 3
Output #2
12 12 0 0
Input #3
10 5
Output #3
1263360 1401600 710400 211200 38400 3840 0 0 0 0
题目信息
题号
arc140_f
时间限制
8 s
内存限制
1024 MB

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