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 Go (1.6) (judge verdict: Runtime Error)

package main
import "fmt"
const mod int64 = 998244353
func main() {
  var k,n int64
  fmt.Scan(&k,&n)
  initlz(k+n)
  a := make([]int64,2*k+1)
  for i:=int64(2);i<k+2;i+=2 {
    for j:=int64(0);j<i/2+1;j++ {
      if k+n-i-1 < 0 || n-j < 0 { continue }
      a[i] = (a[i]+(comb(i/2,j)*((p[j]*comb(k+n-i-1,n-j))%mod))%mod)%mod
    }
    a[i+1] = a[i]
  }
  for i:=k+2;i<2*k+1;i++ { a[i] = a[2*k-i+2] }
  for i:=int64(2);i<2*k+1;i++ { fmt.Println(a[i]) }
}
func min(n,m int64) int64 {
  if n < m { return n }
  return m
}

const size int = 50
var f []int64
var invf []int64
var p []int64
func initlz(n int64) {
  f = make([]int64,n+1)
  invf = make([]int64,n+1)
  p = make([]int64,n+1)
  f[0] = 1
  invf[0] = 1
  p[0] = 1
  for i:=int64(1);i<n+1;i++ {
    f[i] = (f[i-1]*(i%mod))%mod
    invf[i] = inv(f[i])
    p[i] = (p[i-1]*2)%mod
  }
}
func comb(n,k int64) int64 {
  if k < 0 || k > n { return 0 }
  if n == 0 && k == 0 { return 1 }
  if n == 0 { return 0 }
  return (f[n]*((invf[k]*invf[n-k])%mod))%mod
}
func inv(n int64) int64 {
  if n == 1 { return 1 }
  k := make([]int64,size)
  a,b,u := mod,n,size
  for i:=0;i<size;i++ {
    k[i],a,b = a/b,b,a%b
    if b == 0 { u = i;break }
  }
  var y0,y1 int64 = 1,-k[0]
  for i:=1;i<u;i++ { y0,y1 = y1,y0-k[i]*y1 }
  for y1 < 0 { y1 += mod }
  return y1%mod
}