Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
ans = [0] * (k + 2)
S = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**8
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


for i in range(1, k+1):
    if i > n - k + 1:
        print(0)
    else:
        ans[i] = cmb( (k-1), (i-1) , mod ) * cmb( (n-k+1), (i) , mod )
        if ans[i] < 0:
            ans[i] + mod
        print(ans[i])


Fixed submission:
n, k = map(int, input().split())
ans = [0] * (k + 2)
S = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


for i in range(1, k+1):
    if i > n - k + 1:
        print(0)
    else:
        ans[i] = cmb( (k-1), (i-1) , mod ) * cmb( (n - k + 1), (i) , mod ) % mod
        if ans[i] < 0:
            ans[i] + mod
        print(ans[i])

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
ans = [0] * (k + 2)
S = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限


for i in range(1, k+1):
    if i > n - k + 1:
        print(0)
    else:
        ans[i] = cmb( (k-1), (i-1) , mod ) * ( cmb( (n-k+i), (n-k) , mod) - S )
        S += ans[i] 
        if ans[i] < 0:
            ans[i] + mod
        print(ans[i])

Fixed submission:
n, k = map(int, input().split())
ans = [0] * (k + 2)
S = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


for i in range(1, k+1):
    if i > n - k + 1:
        print(0)
    else:
        ans[i] = cmb( (k-1), (i-1) , mod ) * cmb( (n - k + 1), (i) , mod ) % mod
        if ans[i] < 0:
            ans[i] + mod
        print(ans[i])

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

n, k = map(int, input().split())
MOD = 1000000007
ans = [0] * (k + 2)
S = 0

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


for i in range(1, k+1):
    ans[i] = comb( (k-1), (i-1) , exact=True) * ( comb( (n-k+i), (n-k) , exact=True) - S )
    S += ans[i] 
    print(ans[i] % MOD)

Fixed submission:
n, k = map(int, input().split())
ans = [0] * (k + 2)
S = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


for i in range(1, k+1):
    if i > n - k + 1:
        print(0)
    else:
        ans[i] = cmb( (k-1), (i-1) , mod ) * cmb( (n - k + 1), (i) , mod ) % mod
        if ans[i] < 0:
            ans[i] + mod
        print(ans[i])

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

n, k = map(int, input().split())
MOD = 1000000007
ans = [0] * (k + 2)
S = 0

for i in range(1, k+1):
    ans[i] = comb( (k-1), (i-1) , exact=True) * ( comb( (n-k+i), (n-k) , exact=True) - S )
    S += ans[i] 
    print(ans[i] % MOD)


Fixed submission:
n, k = map(int, input().split())
ans = [0] * (k + 2)
S = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


for i in range(1, k+1):
    if i > n - k + 1:
        print(0)
    else:
        ans[i] = cmb( (k-1), (i-1) , mod ) * cmb( (n - k + 1), (i) , mod ) % mod
        if ans[i] < 0:
            ans[i] + mod
        print(ans[i])