Problem:
Score : 700 points

Problem Statement

Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable.
For each i=2,3,...,2K, find the following value modulo 998244353:

The number of combinations of N sides shown by the dice such that the sum of no two different sides is i.

Note that the dice are NOT distinguishable, that is, two combinations are considered different when there exists an integer k such that the number of dice showing k is different in those two.

Constraints

1 \leq K \leq 2000

2 \leq N \leq 2000

K and N are integers.

Input

Input is given from Standard Input in the following format:

K N

Output

Print 2K-1 integers. The t-th of them (1\leq t\leq 2K-1) should be the answer for i=t+1.

Sample Input 1

3 3

Sample Output 1

7
7
4
7
7

For i=2, the combinations (1,2,2),(1,2,3),(1,3,3),(2,2,2),(2,2,3),(2,3,3),(3,3,3) satisfy the condition, so the answer is 7.

For i=3, the combinations (1,1,1),(1,1,3),(1,3,3),(2,2,2),(2,2,3),(2,3,3),(3,3,3) satisfy the condition, so the answer is 7.

For i=4, the combinations (1,1,1),(1,1,2),(2,3,3),(3,3,3) satisfy the condition, so the answer is 4.

Sample Input 2

4 5

Sample Output 2

36
36
20
20
20
36
36

Sample Input 3

6 1000

Sample Output 3

149393349
149393349
668669001
668669001
4000002
4000002
4000002
668669001
668669001
149393349
149393349

Solution in Java8 (OpenJDK 1.8.0) (judge verdict: Wrong Answer)

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int n = sc.nextInt();
        comb();
        for(int i=2; i<=k*2; i++) {
            System.out.println(solve(k, n ,i));
        }
    }

    public static final long MOD = 998244353;

    public static long solve(int k, int n, int i) {
        long res = 0;
        i = Math.min(i, k * 2 + 2 - i);
        int s = 0;
        if(i%2 == 0 ) {
            s = 1;
        }
        int p = (i-1) / 2;
        int r = k - s - p * 2;
        if(s == 1) {
            res += s2(n, p, r);
            res += s2( n-1, p, r);
        } else {
            res += s2(n, p, r);
        }
        return res % MOD;
    }

    public static long s2(int n, int p, int r) {
        long res = 0;
        long mult = 1;
        for(int i=0; i<=p; i++) {
            if(i > n) break;
            int a = r + i;
            int b = n - i;
            res += comb[p][i] * comb[a + b - 1][b] * mult;
            res %= MOD;
            mult *= 2;
            mult %= MOD;
        }
        return res % MOD;
    }

    static long[][] comb = new long[4001][4001];

    public static void comb() {
        comb[0][0] = 1;
        for(int i=1; i<=4000; i++) {
            for(int j=0; j<=i; j++) {
                if(j > 0) {
                    comb[i][j] += comb[i-1][j-1];
                }
                comb[i][j] += comb[i-1][j];
                comb[i][j] %= MOD;
            }
        }
    }
}