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 Python (3.4.3) (judge verdict: Accepted)

K, N = map(int, input().split())
MOD = 998244353

P = N+K
fact = [1]*(P+1)
rfact = [1]*(P+1)
for i in range(P):
    fact[i+1] = r = ((i+1) * fact[i]) % MOD
    rfact[i+1] = pow(r, MOD-2, MOD)

def comb(n, k):
    return fact[n] * rfact[k] * rfact[n-k] % MOD

V = [1]*(P+1)
r = 1
for i in range(P):
    r = (r * 2) % MOD
    V[i+1] = r * rfact[i+1] % MOD

memo = {}
def calc(A):
    if A in memo:
        return memo[A]
    M = A//2
    r = 0
    if A % 2:
        p = K - 2*M + N - 2
        for m in range(max(0, 2*M+2-K), min(M, N-1)+1):
            r += V[m] * rfact[M-m] * (fact[p]*rfact[N-m] + fact[p-1]*rfact[N-m-1])*rfact[p-N+m] % MOD

        if 2*M+2-K <= N <= M:
            r += V[N] * rfact[M-N] % MOD
        r *= fact[M]
    else:
        p = K - 2*M + N - 1
        for m in range(max(0, 2*M+1-K), min(N, M)+1):
            r += V[m] * rfact[M-m] * rfact[N-m] * rfact[p-N+m] % MOD
        r *= fact[M] * fact[p]
    r = memo[A] = r % MOD
    return r
ans = []
for i in range(2, 2*K+1):
    if i <= K:
        ans.append(calc(i - 1))
    else:
        ans.append(calc(2*K - i + 1))
print(*ans, sep='\n')