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 Ruby (2.3.3) (judge verdict: Accepted)

def powmod(b,r,mod)
  a = 1
  while r > 0
    if r%2 == 1
      a = a * b % mod
    end
    b = b * b % mod
    r /= 2
  end
  a
end

def factorial(n, mod)
  fs = [1]
  (1..n).each{ |k| fs << (fs[-1] * k) % mod }
  fs
end

def inv_factorial(n, mod)
  fs = [1]
  f = 1
  (1..n).each{ |k|
    f = f * k % mod
    fs << powmod(f, mod-2, mod)
  }
  fs
end

Mod = 998244353
K,N = gets.split.map(&:to_i)
$fs =     factorial(N+K, Mod)
$is = inv_factorial(N+K, Mod)

def hands(n,a,b)
  a = [a,0].max
  ans = 0
  d = 1
  #p [n,a,b]
  (0..b).each{ |r|
    m = n - r + a + r - 1
    k = r + a - 1
    unless m < 0 || k < 0 || m-k < 0
      v = $fs[b] * $is[r] % Mod * $is[b-r] % Mod * $fs[m] % Mod * $is[k] % Mod * $is[m-k] % Mod * d % Mod
      ans = (ans + v) % Mod
      #puts "#{[r,m,k]} C(#{b}, #{r}) * C(#{m}, #{k}) * 2^#{r} = #{v}"
    end
    d = (d << 1) % Mod
  }
  ans
end

(2..2*K).each{ |i|
  sr = [K, i-1].min
  ir = [i-sr, 1].max
  b = (sr-ir)/2+(i%2 > 0 ? 1 : 0)
  a = K-(sr-ir+1)
  #p [i,ir,sr,a,b]
  if i % 2 == 0
    p (hands(N, a, b) + hands(N-1, a, b)) % Mod
  else
    p hands(N, a, b)
  end
}