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 (Clang 3.8.0) (judge verdict: Accepted)

#include<stdio.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
int n,m,dui;
const int p=998244353;
long long f[11000],inv[11000],bi[11000],ans[11000];
inline long long qpow(int a,int n){
	long long x=a,ans=1;
	while (n){
		if (n&1) ans=ans*x%p;
		x=x*x%p;
		n>>=1;
	}
	return ans;
}
inline long long C(int n,int m){
	if (m<0||m>n) return 0;
	return f[n]*inv[m]%p*inv[n-m]%p;
}
inline int wor(int n,int dui,int num){
	int w=1;long long ans=0;
	fo(i,0,dui){//not use dui
		ans+=bi[dui-i]*C(dui,i)%p*C(n+dui-i+num-1,dui-i+num-1)%p*w;//C(n+dui+num-1,dui+num-1)
		w=-w;
	}
	return (ans%p+p)%p;
}
int main(){
	scanf("%d%d",&m,&n);
	bi[0]=1;
	fo(i,1,m){
		bi[i]=bi[i-1]<<1;
		if (bi[i]>=p) bi[i]-=p;
	}
	f[0]=inv[0]=1;
	fo(i,1,n+m) f[i]=f[i-1]*i%p; 
	inv[n+m]=qpow(f[n+m],p-2);
	fd(i,n+m-1,1) inv[i]=inv[i+1]*(i+1)%p;
	//fo(i,n+m-10,n+m) printf("%d\n",f[i]*inv[i]%p);
	fo(i,2,m+1){
		if (i&1){
			dui++;
			ans[i]=wor(n,dui,m-dui*2);	
		}else{
			ans[i]=wor(n,dui,m-dui*2-1)+wor(n-1,dui,m-dui*2-1);
			if (ans[i]>=p) ans[i]-=p;
		}
		printf("%lld\n",ans[i]);
	} 
	fd(i,m,2) printf("%lld\n",ans[i]);
	return 0;
}