AT_arc213_d [ARC213D] Minimize Inversion
Description
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.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ K $
Output Format
Output $ N $ lines. The $ i $ -th line should contain the answer for $ a = i $ .
Explanation/Hint
### Constraints
- $ 1\leq K\leq N\leq 2\times 10^{5} $
- All input values are integers.