Problem p02990 (python)

Fixed submission:
N, K = map(int, input().split())
import math
mod =10**9+7

l = []
l.append(N-K+1)
for i in range(1, K):
  a = l[i-1] * (N-K-i+1) * (K-i) // ((i+1)*i)
  l.append(int(a))

for j in l:
  print(j%mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math
mod =10**9+7

l = []
for i in range(K):
  a = math.factorial(N-K+1)//(math.factorial(N-K-i)*math.factorial(i+1))
  b = math.factorial(K-1)//(math.factorial(K-1-i)*math.factorial(i))
  ans = int(a)*int(b)
  l.append(int(ans))

for j in l:
  print(j%mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math
mod =10**9+7

l = []
l.append(N-K+1)
for i in range(1, K):
  a = l[i-1] * 1/(i+1) * (N-K-i) * 1/(i) * (K-1-i) 
  l.append(int(a))

for j in l:
  print(j%mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math
mod =10**9+7
import sys
sys.setrecursionlimit(10000000)

l = []
for i in range(K):
  a = math.factorial(N-K+1)/(math.factorial(N-K-i)*math.factorial(i+1))
  b = math.factorial(K-1)/(math.factorial(K-1-i)*math.factorial(i))
  ans = int(a)*int(b)
  l.append(int(ans))

for j in l:
  print(j%mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math
mod =10**9+7
import sys
sys.setrecursionlimit(100000)

l = []
for i in range(K):
  a = math.factorial(N-K+1)/(math.factorial(N-K-i)*math.factorial(i+1))
  b = math.factorial(K-1)/(math.factorial(K-1-i)*math.factorial(i))
  ans = int(a)*int(b)
  l.append(int(ans))

for j in l:
  print(j%mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math
mod =10**9+7

l = []
for i in range(K):
  a = math.factorial(N-K+1)/(math.factorial(N-K-i)*math.factorial(i+1))
  b = math.factorial(K-1)/(math.factorial(K-1-i)*math.factorial(i))
  ans = int(a)*int(b)
  l.append(int(ans))

for j in l:
  print(j%mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math

l = []
for i in range(K):
  a = math.factorial(N-K+1)/(math.factorial(N-K-i)*math.factorial(i+1))
  b = math.factorial(K-1)/(math.factorial(K-1-i)*math.factorial(i))
  ans = int(a)*int(b)
  l.append(int(ans))

for j in l:
  print(j%(10**9+7))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math

l = []
for i in range(K):
  a = math.factorial(N-K+1)/(math.factorial(N-K-i)*math.factorial(i+1))
  b = math.factorial(K-1)/(math.factorial(K-1-i)*math.factorial(i))
  ans = int(a)*int(b)
  l.append(int(ans))

for j in l:
  print(j%(10^9+7))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math

ttl = 0
l = []
for i in range(K):
  a = math.factorial(N-K+1)/(math.factorial(N-K-i)*math.factorial(i+1))
  b = math.factorial(K-1)/(math.factorial(K-1-i)*math.factorial(i))
  ans = a*b
  l.append(ans)

for j in l:
  print(int(j%(10^9+7)))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math

ttl = 0
l = []
for i in range(K):
  a = math.factorial(i+1+N-K)/((math.factorial(N-K+1))*(math.factorial(i)))
  b = math.factorial(K-1+i-1)/((math.factorial(K-1))*(math.factorial(i-1)))
  ans = a*b
  l.append(ans)

for j in l:
  print(int(j%(10^9+7)))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math

ttl = 0
l = []
for i in range(K):
  a = math.factorial(i+2+N-K)/((math.factorial(N-K+1))*(math.factorial(i+1)))
  b = math.factorial(K-1+i)/((math.factorial(K-1))*(math.factorial(i)))
  ans = a*b
  l.append(ans)

for j in l:
  print(int(j%(10^9+7)))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math

ttl = math.factorial(N)/(math.factorial(N-K)*math.factorial(K))
l = []
for i in range(K):
  ans = math.factorial(i+1+N-K)/((math.factorial(N-K))*(math.factorial(i+1)))
  ttl -= ans
  if ttl < 0:
    ans += ttl
  l.append(ans)

for j in l:
  print(int(j%(10^9+7)))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
import math

ttl = math.factorial(N)/(math.factorial(N-K)*math.factorial(K))
l = []
for i in range(K):
  ans = math.factorial(i+1+N-K)/((math.factorial(N-K))*(math.factorial(i+1)))
  ttl -= ans
  if ttl < 0:
    ans += ttl
  l.append(ans)

for j in l:
  print(int(j))