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 <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define MOD 998244353

ll fact[6001],factinv[6001];

ll mpow(ll x, ll p){
    if(p==0) return 1;
    if(p==1) return x%MOD;
    if(p%2==0) return mpow(x*x%MOD,p/2)%MOD;
    else return x*mpow(x*x%MOD,p/2)%MOD;
}

ll conv(ll n, ll r){
    if(n<0 || r<0 || n-r<0) return 0;
    return ((fact[n]*factinv[r])%MOD)*factinv[n-r]%MOD;
}

ll sepptn(ll n, ll to){
    return conv(n+to-1,n)%MOD;
}

int main(){
    fact[0]=1;
    for(int i=1;i<=6000;i++) fact[i]=i*fact[i-1]%MOD;
    for(int i=0;i<=6000;i++) factinv[i]=mpow(fact[i],MOD-2);

    ll K,N;
    cin >> K >> N;

    for(ll i=2;i<=2*K;i++){
        ll ans=0;
        ll kaku=0,pea=0;
        if(i%2==1){
            pea=min(i/2,K-i/2);
            kaku=K-pea*2;
            for(ll j=0;j<=pea;j++){
                if(kaku+j<=0) continue;
                ans=(ans+sepptn(N-j,j+kaku)*mpow(2,j)%MOD*conv(pea,j)%MOD)%MOD;
            }
        }else{
            pea=min(i/2-1,K-i/2);
            kaku=K-1-pea*2;
            for(ll j=0;j<=pea;j++){
                ans=(ans+sepptn(N-j,j+kaku)*mpow(2,j)%MOD*conv(pea,j)%MOD)%MOD;
                ans=(ans+sepptn(N-1-j,j+kaku)*mpow(2,j)%MOD*conv(pea,j)%MOD)%MOD;
            }
        }
        cout << ans << endl;
    }

    
    return 0;
}