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: Wrong Answer)

#include<bits/stdc++.h>
using namespace std;

using ll=long long;
const ll MOD=998244353;

const int SIZE=5000;
ll dp[SIZE][SIZE];
ll p2[SIZE];
ll comb(ll n,ll k){
    return dp[n][k];    
}
ll pow2(ll x){
    return p2[x];
}
ll g(int n,int k){
    return comb(n+k-1,n);
}
ll f(int n,int p,int k){
    ll res=0;
    for(int i=0;i<=p;i++){
        res+=pow2(i)*comb(p,i)%MOD*g(n-i,k+i);
        res%=MOD;
    }
    return res;
}
void init(){
    for(int i=0;i<SIZE;i++){
        dp[i][i]=1;
        dp[i][0]=1;
    }
    for(int i=2;i<SIZE;i++){
        for(int j=1;j<i;j++){
            dp[i][j]=(dp[i-1][j]+dp[i-1][j-1])%MOD;
        }
    }
    p2[0]=1;
    for(int i=0;i<SIZE;i++){
        p2[i+1]=p2[i]*2%MOD;
    }
}
int main(){
    init();
    int k,n;
    cin>>k>>n;
    for(int i=2;i<=2*k;i++){
        if(i%2==0){
            int c=min(i/2-1,k-i/2);
            ll v0=f(n-1,c,k-1-2*c);
            ll v1=f(n,c,k-1-2*c);
            cout<<(v0+v1)%MOD<<endl;
        }
        else{
            int c=min((i-1)/2,k-(i-1)/2);
            ll v0=f(n,c,k-2*c);
            cout<<v0<<endl;
        }
    }
    return 0;
}