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 <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
 
using namespace std;
typedef long long ll;
 
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
long long int mod = 998244353;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<ll> G[100005];
vector<P> tree[100010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
//↓,→,↑,←
 
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<x;
#define re(i,a,b) for(i=a;i<=b;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl

ll rui(ll abc,ll bed){
	//aのb乗を計算する
	if(bed==0){return 1;}
	else{
		ll ced = rui(abc,bed/2);
		ced *= ced;
		ced %= mod;
		if(bed%2==1){ced*=abc; ced%=mod;}
		return ced;
	}
} 

ll i,j,k,ii,jj;
ll n,m,num,sumxor,sum,ans;
ll a,b,c,d,e,f,g,h,w,v,p;
string s[500005];
string t;
ll x[800005],y[800005],z[900005];
ll dp[10000][10000];


int main(){	
	cin>>k>>n;
	dp[0][0]=1;
	for(i=0;i<=9950;i++){
		for(j=0;j<=i;j++){
			if(i==j || j==0){
				dp[i][j]=1;
			}else{
				dp[i][j]=dp[i-1][j]+dp[i-1][j-1];
				dp[i][j] %= mod;
			}
		}
	}
	//dp[i][j] := i C j
	for(i=2;i<=2*k;i++){
		ans = 0;
		if(i%2==1){
			if(i<=k){
				p = i/2;
			}else{
				p = (2*k+2-i)/2;
			}
			for(j=0;j<=p;j++){
				//p個のpairのうちj個には何にもない
				g = k - p - j;
				//出していい目がg個
				num = dp[p][j];
				ans += num * dp[n+g-1-p+j][g-1] * rui(2,p-j);
				ans %= mod;
			}
		}else{
			//iが偶数の時
			if(i<=k){
				p = i/2 -1;
			}else{
				p = (2*k+2-i)/2 -1;
			}
			for(j=0;j<=p;j++){
				g = k - p - j;
				//出していい目がg個
				num = dp[p][j];
				ans += num * dp[n+g-2-p+j][g-2] * rui(2,p-j);
				ans %= mod;
				n--;
				g = k - p - j;
				//出していい目がg個
				num = dp[p][j];
				ans += num * dp[n+g-2-p+j][g-2] * rui(2,p-j);
				ans %= mod;
				n++;
			}
		}
		p(ans);
	}
	return 0;
}