Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
#if min(K, N-K+1) == N-K+1:
#    for i in range(N-K+1, K):
#        print(0)


Fixed submission:
def comb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n-r)
import math

MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(K):
    if N-K - j < 0:
        print(0)
        continue
    tmp = (comb(N-K+1, j+1)) % MOD
    print(int((comb(K-1, j) * tmp) % MOD))

Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
if min(K, N-K+1) == N-K+1:
    for i in range(N-K+1, K):
        print(0)


Fixed submission:
def comb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n-r)
import math

MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(K):
    if N-K - j < 0:
        print(0)
        continue
    tmp = (comb(N-K+1, j+1)) % MOD
    print(int((comb(K-1, j) * tmp) % MOD))

Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
if min(K, N-K+1) == N-K+1:
    for i in range(N-K+1, K):
        print(0)


Fixed submission:
def comb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n-r)
import math

MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(K):
    if N-K - j < 0:
        print(0)
        continue
    tmp = (comb(N-K+1, j+1)) % MOD
    print(int((comb(K-1, j) * tmp) % MOD))

Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
if min(K, N-K+1) == N-K+1:
    for i in range(N-K+1, K):
        print(0)


Fixed submission:
def comb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n-r)
import math

MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(K):
    if N-K - j < 0:
        print(0)
        continue
    tmp = (comb(N-K+1, j+1)) % MOD
    print(int((comb(K-1, j) * tmp) % MOD))

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
import math
MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(min(K, N-K+1)):
    if j != N-K:
        tmp = (comb(N-K+1, j+1)) % MOD
    else:
        tmp = 1
    print(int((comb(K-1, j) * tmp) % MOD))
if min(K, N-K+1) == N-K+1:
    for i in range(N-K+1, K):
        print(0)


Fixed submission:
def comb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n-r)
import math

MOD = 10 ** 9 + 7
N, K = map(int, input().split())
ans = 0
for j in range(K):
    if N-K - j < 0:
        print(0)
        continue
    tmp = (comb(N-K+1, j+1)) % MOD
    print(int((comb(K-1, j) * tmp) % MOD))