Buggy python submission (verdict: Runtime Error):
import math

N, K = map(int, input().split())


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


w = 10**9+7
for i in range(1, K+1):
    if N-K+1-i > 0:
        ans1 = combinations_count(N-K+1, i)
        ans2 = combinations_count(K-1, i-1)
        ans = ans1 % w * ans2 % w
        print(ans)
        cnt += ans
    else:
        print(combinations_count(N, K) % w-cnt)


Fixed submission:
import math

N, K = list(map(int, input().split()))
mod = 10**9+7


def combination(a, b):
    ans = (math.factorial(a) // math.factorial(a-b)) // math.factorial(b)
    return ans


for i in range(1, K+1):
    if (N-K+1-i) >= 0:
        ans1 = combination(N-K+1, i)
        ans2 = combination(K-1, i-1)
        print(ans1 % mod*ans2 % mod)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
import math

N, K = list(map(int, input().split()))
mod = 10**9+7


def combination(a, b):
    kekka = (math.factorial(a) // math.factorial(a-b)) // math.factorial(b)
    return kekka


for i in range(1, K+1):
    ans1 = combination(N-K+1, i)
    ans2 = combination(K-1, i-1)
    if (N-K+1-i) >= 0:
        print(ans1*ans2 % mod)


Fixed submission:
import math

N, K = list(map(int, input().split()))
mod = 10**9+7


def combination(a, b):
    ans = (math.factorial(a) // math.factorial(a-b)) // math.factorial(b)
    return ans


for i in range(1, K+1):
    if (N-K+1-i) >= 0:
        ans1 = combination(N-K+1, i)
        ans2 = combination(K-1, i-1)
        print(ans1 % mod*ans2 % mod)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
import math

N, K = list(map(int, input().split()))
mod = 10**9+7


def combination(a, b):
    ans = (math.factorial(a) // math.factorial(a-b)) // math.factorial(b)
    return ans


for i in range(1, K+1):
    ans1 = combination(N-K+1, i)
    ans2 = combination(K-1, i-1)
    print(ans1*ans2 % mod)


Fixed submission:
import math

N, K = list(map(int, input().split()))
mod = 10**9+7


def combination(a, b):
    ans = (math.factorial(a) // math.factorial(a-b)) // math.factorial(b)
    return ans


for i in range(1, K+1):
    if (N-K+1-i) >= 0:
        ans1 = combination(N-K+1, i)
        ans2 = combination(K-1, i-1)
        print(ans1 % mod*ans2 % mod)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
import math

N, K = list(map(int, input().split()))

red = N-K + 1

#print(N, K, red)
cnt = 0
for i in range(1,K):
    ans = math.factorial(red) // (math.factorial(red - i) * math.factorial(i))*i
    w = 10**9+7
    print(ans%w)
    cnt+=ans

All =  math.factorial(N) // (math.factorial(N-K) * math.factorial(K))%(10**9+7)
print(All-cnt)

Fixed submission:
import math

N, K = list(map(int, input().split()))
mod = 10**9+7


def combination(a, b):
    ans = (math.factorial(a) // math.factorial(a-b)) // math.factorial(b)
    return ans


for i in range(1, K+1):
    if (N-K+1-i) >= 0:
        ans1 = combination(N-K+1, i)
        ans2 = combination(K-1, i-1)
        print(ans1 % mod*ans2 % mod)
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
import math

N, K = list(map(int, input().split()))

red = N-K + 1

#print(N, K, red)
cnt = 0
for i in range(1,K):
    ans = math.factorial(red) // (math.factorial(red - i) * math.factorial(i))*i
    w = 10**9+7
    print(ans%w)
    cnt+=ans

All =  math.factorial(N) // (math.factorial(N-K) * math.factorial(K))%(10**9+7)
print(All-cnt)

Fixed submission:
import math

N, K = list(map(int, input().split()))
mod = 10**9+7


def combination(a, b):
    ans = (math.factorial(a) // math.factorial(a-b)) // math.factorial(b)
    return ans


for i in range(1, K+1):
    if (N-K+1-i) >= 0:
        ans1 = combination(N-K+1, i)
        ans2 = combination(K-1, i-1)
        print(ans1 % mod*ans2 % mod)
    else:
        print(0)