Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
MOD = 1000000007

fact = [1]
for i in range(1, N):
  fact.append(fact[-1] * i)

def comb(n, k):
  return (fact[n] // (fact[n - k] * fact[k])) % MOD

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Fixed submission:
N, K = map(int, input().split())
MOD = 1000000007

fact = [1]
for i in range(1, N):
  fact.append(fact[-1] * i)

def comb(n, k):
  return (fact[n] // (fact[n - k] * fact[k])) % MOD

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return 0
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
MOD = 1000000007

C = [[0 for _ in range(4005)] for _ in range(4005)]
C[0][0] = 1
for i in range(4000):
  for j in range(4000):
    C[i + 1][j] += C[i][j] % MOD
    C[i + 1][j + 1] += C[i][j] % MOD

def comb(n, k):
  return C[n][k]

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Fixed submission:
N, K = map(int, input().split())
MOD = 1000000007

fact = [1]
for i in range(1, N):
  fact.append(fact[-1] * i)

def comb(n, k):
  return (fact[n] // (fact[n - k] * fact[k])) % MOD

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return 0
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
MOD = 1000000007

C = [[0 for _ in range(4005)] for _ in range(4005)]
C[0][0] = 1
for i in range(4000):
  for j in range(4000):
    C[i + 1][j] += C[i][j]
    C[i + 1][j + 1] += C[i][j]

def comb(n, k):
  return C[n][k]

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Fixed submission:
N, K = map(int, input().split())
MOD = 1000000007

fact = [1]
for i in range(1, N):
  fact.append(fact[-1] * i)

def comb(n, k):
  return (fact[n] // (fact[n - k] * fact[k])) % MOD

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return 0
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
MOD = 1000000007

def f(n, k, i):
  if i == 1:
    return n - k + 1
  if i == 2:
    return (n - k + 1) * (n - k) // 2 * (k - 1)
  
  ret = 0
  for j in range(1, k - i + 2):
    for l in range(j + 1, n - k + j + 1):
      ret += f(n - l, k - j, i - 1)
  return ret

for i in range(1, K + 1):
  print(f(N, K, i) % MOD)

Fixed submission:
N, K = map(int, input().split())
MOD = 1000000007

fact = [1]
for i in range(1, N):
  fact.append(fact[-1] * i)

def comb(n, k):
  return (fact[n] // (fact[n - k] * fact[k])) % MOD

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return 0
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
MOD = 1000000007
checked = [[[False for _ in range(K * 2)] for _ in range(K * 2)] for _ in range(N * 2)]
ans_f = [[[0 for _ in range(K * 2)] for _ in range(K * 2)] for _ in range(N * 2)]

def f(n, k, i):
  if i == 1:
    return n - k + 1
  if checked[n][k][i]:
    return ans_f[n][k][i]
  
  ret = 0
  for j in range(1, k - i + 2):
    for l in range(j + 1, n - k + j + 1):
      tmp =  f(n - l, k - j, i - 1)
      checked[n - l][k - j][i - 1] = True
      ans_f[n - l][k - j][i - 1] = tmp
      ret += tmp
  return ret

for i in range(1, K + 1):
  print(f(N, K, i) % MOD)

Fixed submission:
N, K = map(int, input().split())
MOD = 1000000007

fact = [1]
for i in range(1, N):
  fact.append(fact[-1] * i)

def comb(n, k):
  return (fact[n] // (fact[n - k] * fact[k])) % MOD

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return 0
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
MOD = 1000000007
checked = [[[False for _ in range(K * 2)] for _ in range(K * 2)] for _ in range(N * 2)]
ans_f = [[[0 for _ in range(K * 2)] for _ in range(K * 2)] for _ in range(N * 2)]

def f(n, k, i):
  if i == 1:
    return n - k + 1
  if checked[n][k][i]:
    return ans_f[n][k][i]
  
  ret = 0
  for j in range(1, k - i + 2):
    for l in range(j + 1, n - k + j + 1):
      tmp =  f(n - l, k - j, i - 1)
      checked[n - l][k - j][i - 1] = True
      ans_f[n - l][k - j][i - 1] = tmp
      ret += tmp
  return ret

for i in range(1, K + 1):
  print(f(N, K, i) % MOD)

Fixed submission:
N, K = map(int, input().split())
MOD = 1000000007

fact = [1]
for i in range(1, N):
  fact.append(fact[-1] * i)

def comb(n, k):
  return (fact[n] // (fact[n - k] * fact[k])) % MOD

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return 0
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
MOD = 1000000007

def f(n, k, i):
  if i == 1:
    return n - k + 1
  
  ret = 0
  for j in range(1, k - i + 2):
    for l in range(j + 1, n - k + j + 1):
      ret += f(n - l, k - j, i - 1)
  return ret

for i in range(1, K + 1):
  print(f(N, K, i) % MOD)

Fixed submission:
N, K = map(int, input().split())
MOD = 1000000007

fact = [1]
for i in range(1, N):
  fact.append(fact[-1] * i)

def comb(n, k):
  return (fact[n] // (fact[n - k] * fact[k])) % MOD

def f2(n, k):
  return comb(n + k - 1, k - 1)

def f(n, k):
  if n < k:
    return 0
  if n == 0 and k == 0:
    return 1
  if k < 1:
    return 0
  return f2(n - k, k)

for i in range(1, K + 1):
  blue = f(K, i)
  red = (f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)) % MOD
  ans = blue * red
  print(ans % MOD)