AtCoder Regular Contest 213 (Div. 1)
D
Minimize Inversion
AtCoder
⌀ 3202
原题
← C→
翻译中…

Problem Statement

翻译中…

You are given positive integers $N$ and $K$ satisfying $1\leq K\leq N$.

翻译中…

For a permutation $P = (P_{1}, P_{2}, \dots , P_{N})$ of $(1, 2, \dots , N)$, define $f(P)$ as follows:

翻译中…
  • The minimum possible value of the number of inversions of a length-$N$ integer sequence $A = (A_{1}, A_{2}, \dots, A_{N})$ satisfying the following condition:
  • $|A_{i}| = P_{i}$ for every integer $1\leq i\leq N$.
翻译中…

For $a = 1, 2, \dots, N$, answer the following question:

翻译中…

There are $(N - 1)!$ permutations $P = (P_{1}, P_{2}, \dots , P_{N})$ of $(1, 2, \dots , N)$ satisfying $P_{K} = a$. Find the sum, modulo $998244353$, of $f(P)$ over all of them.

翻译中…

Constraints

翻译中…
  • $1\leq K\leq N\leq 2\times 10^{5}$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N K

翻译中…

Output

翻译中…

Output $N$ lines. The $i$-th line should contain the answer for $a = i$.

翻译中…

样例

Input #1
4 2
Output #1
3
3
6
8
Input #2
1 1
Output #2
0
Input #3
16 7
Output #3
262718137
262718137
826158422
869037161
443336358
897729892
154945392
124681723
861272045
3176021
900143166
451899023
365015181
740245202
732524873
391198612
题目信息
题号
arc213_d
时间限制
2 s
内存限制
1024 MB

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