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 C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>

const int MOD = (int)998244353;
const int kN = 4000 + 5;
int Inv[kN], Finv[kN], F[kN];
int pw2[kN];

int binom(int a, int b) {
  if (b < 0 || b > a) return 0;
  return F[a] * 1LL * Finv[b] % MOD * Finv[a - b] % MOD;
}

int calc(int n, int k, int ban) {
  int r = k - 2 * ban;
  int ret = 0;
  for (int i = 0; i <= ban && i <= n; ++ i) {
    (ret += pw2[i] * 1LL * binom(n - i + r + i - 1, r + i - 1) % MOD * binom(ban, i) % MOD) %= MOD;
  }
  return ret;
}

int solve(int n, int k, int ban, int single) {
  int ret = 0;
  for (int w = 0; w <= single; ++ w) {
    (ret += calc(n - w, k - single, ban)) %= MOD;
  }
  return ret;
}

int main() {
  pw2[0] = 1;
  for (int i = 1; i < kN; ++ i)
    pw2[i] = pw2[i - 1] * 1LL * 2 % MOD;
  Inv[1] = 1;
  for (int i = 2; i < kN; ++ i)
    Inv[i] = (MOD - MOD / i) * 1LL * Inv[MOD % i] % MOD;
  F[0] = Finv[0] = 1;
  for (int i = 1; i < kN; ++ i) {
    F[i] = F[i - 1] * 1LL * i % MOD;
    Finv[i] = Finv[i - 1] * 1LL * Inv[i] % MOD;
  }
  int n, k;
  scanf("%d%d", &k, &n);
  for (int i = 2; i <= 2 * k; ++ i) {
    int ban = 0, single = 0;
    for (int j = 1; j <= k; ++ j) {
      int r = i - j;
      if (j <= r && r >= 1 && r <= k) {
        if (j == r)
          ++ single;
        else
          ++ ban;
      }
    }
    printf("%d\n", solve(n, k, ban, single));
  }
}