Buggy python submission (verdict: Runtime Error):
def cmb(n, k, mod, fac, ifac):
    """
    nCkを計算する
    """
    k = min(k, n-k)
    return fac[n] * ifac[k] * ifac[n-k] % mod

def make_tables(mod, n):
    """
    階乗テーブル、逆元の階乗テーブルを作成する
    """
    fac = [1, 1] # 階乗テーブル・・・(1)
    ifac = [1, 1] #逆元の階乗テーブル・・・(2)
    inverse = [0, 1] #逆元テーブル・・・(3)
    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac
mod = 10**9+7
def cmb_count(n,k):
    fac,ifac = make_tables(mod,n)
    return cmb(n,k,mod,fac,ifac)

n,k = map(int,input().split())
for i in range(1,k+1):
    print(cmb_count(n-k+1,i)*cmb_count(k-1,i-1))


Fixed submission:
class Combination():
    def __init__(self, n, mod=10**9+7):
        self.mod = mod
        self.fac = [1]*(n+1)
        for i in range(1,n+1):
            self.fac[i] = self.fac[i-1] * i % self.mod
        self.invfac = [1]*(n+1)
        self.invfac[n] = pow(self.fac[n], self.mod - 2, self.mod)
        for i in range(n-1, 0, -1):
            self.invfac[i] = self.invfac[i+1] * (i+1) % self.mod
 
    def combination(self, n, r):
        return self.fac[n] * self.invfac[r] % self.mod * self.invfac[n-r] % self.mod
 
    def permutation(self, n, r):
        return self.factorial(n) * self.invfactorial(n-r) % self.mod
 
    def factorial(self, i):
        return self.fac[i]
 
    def invfactorial(self, i):
        return self.invfac[i]

mod = 10**9+7
N,K = map(int,input().split())
ans_ls = [0] * K
c = Combination(N+K)
for i in range(K):
    Blocks = i+1
    #print('-----')
    #print('B:',Blocks)
    if N-K+1>=Blocks:
        Points = c.combination(N-K+1,Blocks)
    else:
        Points = 0
    #print('入れ方：',Points)
    Division = c.combination(K-1,Blocks-1)
    #print('分け方：',Division)
    ans_ls[i] = (Points*Division)%mod

for ans in ans_ls:
    print(ans)

Buggy python submission (verdict: Runtime Error):
def cmb(n, k, mod, fac, ifac):
    """
    nCkを計算する
    """
    k = min(k, n-k)
    return fac[n] * ifac[k] * ifac[n-k] % mod

def make_tables(mod, n):
    """
    階乗テーブル、逆元の階乗テーブルを作成する
    """
    fac = [1, 1] # 階乗テーブル・・・(1)
    ifac = [1, 1] #逆元の階乗テーブル・・・(2)
    inverse = [0, 1] #逆元テーブル・・・(3)
    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac

mod = 10**9+7
n,k = map(int,input().split())
for i in range(1,k+1):
    fac,ifac = make_tables(mod,k-1)
    n_divide = cmb(k-1,i-1,mod,fac,ifac)
    fac,ifac = make_tables(mod,n-k+1)
    n_amari = cmb(n-k+1,i,mod,fac,ifac)
    print(n_amari*n_divide)


Fixed submission:
class Combination():
    def __init__(self, n, mod=10**9+7):
        self.mod = mod
        self.fac = [1]*(n+1)
        for i in range(1,n+1):
            self.fac[i] = self.fac[i-1] * i % self.mod
        self.invfac = [1]*(n+1)
        self.invfac[n] = pow(self.fac[n], self.mod - 2, self.mod)
        for i in range(n-1, 0, -1):
            self.invfac[i] = self.invfac[i+1] * (i+1) % self.mod
 
    def combination(self, n, r):
        return self.fac[n] * self.invfac[r] % self.mod * self.invfac[n-r] % self.mod
 
    def permutation(self, n, r):
        return self.factorial(n) * self.invfactorial(n-r) % self.mod
 
    def factorial(self, i):
        return self.fac[i]
 
    def invfactorial(self, i):
        return self.invfac[i]

mod = 10**9+7
N,K = map(int,input().split())
ans_ls = [0] * K
c = Combination(N+K)
for i in range(K):
    Blocks = i+1
    #print('-----')
    #print('B:',Blocks)
    if N-K+1>=Blocks:
        Points = c.combination(N-K+1,Blocks)
    else:
        Points = 0
    #print('入れ方：',Points)
    Division = c.combination(K-1,Blocks-1)
    #print('分け方：',Division)
    ans_ls[i] = (Points*Division)%mod

for ans in ans_ls:
    print(ans)