P26641 [AtCoder] Sort A[i]-i
NOI
题目描述

Problem Description

Given positive integers \( N \) and \( M \), where \( N < M \).

A sequence of non-negative integers \( a = (a_1, a_2, \cdots, a_N) \) that satisfies the following conditions is called a good sequence:

  • \( 0 \leq a_1 \leq a_2 \leq \cdots \leq a_N \leq M \)

For a good sequence \( a \), let \( f(a) \) denote the sequence obtained by sorting \( (a_1-1, a_2-2, \cdots, a_N-N) \) in ascending order.

For each \( k = 1, 2, \cdots, N \), solve the following problem:

  • Consider all possible good sequences \( a \) and find the \( k \)-th element of \( f(a) \). Compute the sum of these values modulo \( 998244353 \).

Note: The remainder when dividing a negative number should also be in the range \( 0 \) to \( 998244353 \).

Input Format

The input is given from the standard input in the following format:

\( N \) \( M \)

Output Format

Output \( N \) lines. The \( i \)-th line should contain the answer for \( k = i \).

Sample Input and Output

Sample Input #1

2 3

Sample Output #1

998244349
4

Sample Input #2

3 4

Sample Output #2

998244329
0
24

Sample Input #3

4 6

Sample Output #3

998244233
35
175
330

Sample Input #4

10 1000000

Sample Output #4

297189103
747015740
88545731
123651717
920498165
977169022
775771117
810877103
152407094
602233731

Notes/Hints

Constraints

  • \( 1 \leq N < M \leq 10^6 \)
  • All values given in the input are integers.

Sample Explanation 1

Possible \( a \) and corresponding \( f(a) \) are as follows:
- \( a = (0, 0) \): \( f(a) = (-2, -1) \)
- \( a = (0, 1) \): \( f(a) = (-1, -1) \)
- \( a = (0, 2) \): \( f(a) = (-1, 0) \)
- \( a = (0, 3) \): \( f(a) = (-1, 1) \)
- \( a = (1, 1) \): \( f(a) = (-1, 0) \)
- \( a = (1, 2) \): \( f(a) = (0, 0) \)
- \( a = (1, 3) \): \( f(a) = (0, 1) \)
- \( a = (2, 2) \): \( f(a) = (0, 1) \)
- \( a = (2, 3) \): \( f(a) = (1, 1) \)
- \( a = (3, 3) \): \( f(a) = (1, 2) \)

Thus, the sum of the 1st elements of \( f(a) \) is \(-4\), and the sum of the 2nd elements of \( f(a) \) is \( 4 \).

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 3
样例输出
998244349 4