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;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define ph push
#define f first
#define s second
#define cbr cerr << "hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ((ll)x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define btinpct(x) __builtin_popcountll((x))
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return (rng() % (y+1-x)) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

typedef long long ll; 
typedef long double ld;
#define FOR(ii, ss, ee) for(ll ii = (ss); ii <= (ll)(ee); ++ii)
#define DEC(ii, ss, ee) for(ll ii = (ss); ii >= (ll)(ee); --ii)
typedef pair <ll, ll> pi; typedef pair <ll, pi> spi; typedef pair <pi, pi> dpi;

#define LLINF ((long long) 1e18)//1234567890987654321
#define INF 1234567890ll
// #define cerr if(0)cout
#define MAXN (2006)
ll n,k,mi[MAXN*2],dp[MAXN][MAXN][2][2],f[MAXN*2];
const ll mod=998244353;
int main()
{
	FAST
	cin>>k>>n; mmst(dp,-1);
	function<ll(ll,ll)> qexp=[&](ll x,ll e) {
		if(e==0) return 1ll;
		ll half=qexp(x,e>>1);
		half*=half, half%=mod;
		if(e&1) half*=x, half%=mod;
		return half;
	};
	auto C=[&](ll n,ll k) {
		if(n<k) return 0ll;
		return f[n]*mi[k]%mod*mi[n-k]%mod;
	};
	function<ll(ll,ll,ll,ll)> FF=[&](ll n,ll k,ll full,ll fixed) {
		// if empty, but fixed, return 0, thanks
		if(n==0) return ll(fixed==0);
		if(k==0) return 0ll;
		if(~dp[n][k][full][fixed]) return dp[n][k][full][fixed];
		ll &ans=dp[n][k][full][fixed];
		if(fixed) {
			ans=FF(n-1,k-1,1,0) + FF(n-1,k,0,1);
			ans%=mod;
		} else {
			ans=FF(n,k-1,1,0)+FF(n-1,k,0,1)*(full+1)%mod+FF(n-1,k-1,1,0)*(full+1)%mod;
			ans%=mod;
		}
		return ans;
	};
	auto F=[&](ll n,ll k) {
		assert(k%2==0);
		return FF(n, k/2ll,1,0);
	};
	mi[0]=1; f[0]=1;
	FOR(i,1,4002) f[i]=f[i-1]*i%mod, mi[i]=qexp(f[i], mod-2);
	vector<ll> v;
	FOR(i,2,2*k) {
		if(i>k+1) continue;
		ll ans = 0;
		ll x = max(0ll, k-i+1);
		ll val = (i>k?k:i-1);
		// cerr<<x<<' ';
		FOR(j,0,n) {
			// cerr<<"n-j: "<<n-j<<' '<<val<<' '<<F(n-j, val-(val%2==1))<<'\n';
			ans += (x?C(j+x-1, x-1):(j==0)) * F(n-j, val-(val%2==1)) % mod, ans %= mod;
		}
		if(val%2 == 1) {
			-- n;
			FOR(j,0,n) {
				ans += (x?C(j+x-1, x-1):(j==0)) * F(n-j, val-(val%2==1)) % mod, ans %= mod;
			}
			++ n;
		}
		// cerr<<i<<": ";
		cout<<ans<<'\n';
		v.pb(ans);
	}
	v.pop_back();
	while(v.size()) cout<<v.back()<<'\n', v.pop_back();
}