Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02951 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(max(0,c-a+b))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(max(0,c-a+b)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(max(0,c-a+b)
Problem p02835 (python)

Fixed submission:
a, b, c= map(int, input().split())
if a+b+c <= 21:
  print("win")
else:
  print("bust")

Buggy submission (verdict: Runtime Error):
import sys

a = sys.argv[1]
b = sys.argv[2]
c = sys.argv[3]

d = a + b +c

if d < 22;
	print("win")
else;
	print("bust")
Problem p02879 (python)

Fixed submission:
a,b = list(map(int, input().split()))

if a > 9 or b > 9:
    print(-1)
else:
    print(a*b)

Buggy submission (verdict: Runtime Error):
N = int(input())

for i in range(1,10):
    for j in range(1,10):
        if i * j == N:
            print("Yes")
            quit()
print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input.split())

if a>9 and b>9:
    print(-1)
else:
    print(a*b)
Problem p02881 (python)

Fixed submission:
import math

N = int(input())
ans = N-1
for i in range(1, int(math.sqrt(N)+1)):
    if N%i==0:
        ans = min(ans, i+(N/i)-2)
print(int(ans))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
ans = N-1
for i in range(1, math.sqrt(N)+1):
    if N%i==0:
        ans = min(ans, i+(N/i)-2)
print(ans)
Problem p02987 (python)

Fixed submission:
a = input()
a = sorted(a)

if a[0] == a[1] and a[2] == a[3] and a[1] != a[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = input()
a.sort()

if a[0]==a[1] and a[2]==a[3] and a[1]!=a[3]:
    print("Yes")
else:
    print("No")
Problem p03075 (python)

Fixed submission:
a,b,c,d,e,k = [int(input()) for i in range(6)]
print("Yay!" if abs(a - e) <= k else ":(")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,k = int(input()) for i in range(6)
print("Yay!" if e - a <= k else ":(")
Problem p02989 (python)

Fixed submission:
K=int(input())
D=[int(x) for x in input().split()]
D.sort()
M=K/2
m=M-1
ans=D[int(M)]-D[int(m)]
print(ans)

Buggy submission (verdict: Runtime Error):
8
9 1 14 5 5 4 4 14
Problem p03242 (python)

Fixed submission:
s = input()
t = []
for i in range(len(s)):
  if s[i] == '1':
    t.append('9')
  else:
    t.append('1')
print(''.join(t))

Buggy submission (verdict: Runtime Error):
s = input()
t = []
for i in range(len(s)):
  if s[i] == '1':
    t.append('9')
  elif:
    t.append('1')
print(''.join(t))
Problem p03135 (python)

Fixed submission:
T,x = map(int, input().split())
#print(T,x)
t = T/x
print(round(t,10))

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
#print(a)
if N > M:
    ans = 0
else:
    distance = [abs(a[i+1] - a[i]) for i in range(M-1)]
    #print(distance)
    distance.sort()
    #print(distance)
    del distance[M-N:]
    ans = 0 
    for j in distance:
        ans += j
print(ans)
Problem p03137 (python)

Fixed submission:
N, M = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
#print(a)
if N > M:
    ans = 0
else:
    distance = [abs(a[i+1] - a[i]) for i in range(M-1)]
    #print(distance)
    distance.sort()
    #print(distance)
    del distance[M-N:]
    ans = 0 
    for j in distance:
        ans += j
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
#print(a)
if N>M:
    ans = 0
else
    distance = [abs(a[i+1] - a[i]) for i in range(M-1)]
    #print(distance)
    distance.sort()
    #print(distance)
    del distance[M-N:]
    ans = 0 
    for j in distance:
        ans += j
print(ans)
Problem p02862 (python)

Fixed submission:
p = 10 ** 9 + 7
 
def mod_inverse(a, p):
    mod = 1
    p_bin = bin(p-2)
    for i in range(len(p_bin) - 1, 1, -1):
        if i == len(p_bin) - 1:
            mul = a
            mul %= p
            mod *= (mul ** int(p_bin[i]))
            mod %= p
        else:
            mul = mul ** 2
            mul %= p
            mod *= (mul ** int(p_bin[i]))
            mod %= p
    return mod
 
def combination(n, k, p):
    a = 1
    for i in range(n, n - k, -1):
        a *= i
        a %= p
    b = 1
    for i in range(k):
        b *= (i + 1)
        b %= p
    return (a * mod_inverse(b, p)) % p

X,Y = input().split()
X,Y = int(X),int(Y)

if((X-2*Y)%3 !=0 or (2*X-Y)%3 != 0):
    print(0)
    
else:
    a = (-X+2*Y)//3
    b = (2*X-Y)//3
    if(a<0 or b<0):
        print(0)
    else:
        
        print(combination(a+b,b,p))

Buggy submission (verdict: Runtime Error):
X,Y = input().split()
X,Y = int(X),int(Y)

def d(r,n,p):#r^n mod p
    if(n==0):
        return 1
    
    elif(n%2==0):
        d_ = d(r,n//2,p)
        return (d_**2)%p
    
    else:
        d_ = d(r,(n-1),p)
        return (d_*r)%p
    
def fac(n,p):#n! mod p
    mul = 1
    for i in range(1,n+1):
        mul = (mul*i)%p
        
def r_fact_p(r,p):#(r!)^(p-2)
    mul = 1
    for i in range(1,r+1): #i^(p-2)
        mul = (mul*d(i,p-2,p))%p
        
    return mul

def C(n,r):
    return (d(r,n,p)*r_fact_p(r,p))%p



if((X-2*Y)%3 !=0 or (2*X-Y)%3 != 0):
    print(0)
    
else:
    a = (-X+2*Y)//3
    b = (2*X-Y)//3
    
    if(a<0 or b<0):
        print(0)
    else:
        
    print(C(a+b,b))
Problem p02897 (python)

Fixed submission:
N = int(input())
if(N%2==0):
    print(0.5)
else:
    print((0.5*(N+1))/N)

Buggy submission (verdict: Runtime Error):
N,M = input().split()
N,M = int(N),int(M)
a = [0 for i in range(M)]
b = [[] for i in range(M)]

for k in range(M):
    a[k],b_ = input().split()
    a[k],b_ = int(a[k]),int(b_)
    
    b[k] = input().split()
    b[k] = [int(j)-1 for j in b[k]] 
#print(b)
def box(i,bo):#i :i番目の鍵 b空いている宝箱
    #if(0 not in bo):
        #i=M
        #return 0
    #elif(i==M and 0 in bo):
        #return 1e+20
    
    if(i==M):
        if(0 in bo):
            return 1e+20
        else:
            return 0
    else:
        if(0 not in bo):
            return 0
    
        else:
        
            p1 = box(i+1,bo)

            new_bo = bo.copy()
            for k in range(len(b[i])):
                new_bo[b[i][k]] += 1

            p2 = box(i+1,new_bo)+a[i]
            return min([p1,p2])
        
box_ = [0 for i in range(N)]
num = box(0,box_)
if(num>=1e+20):
    print(-1)
else:
    print(num)
    
#宝箱はN(<=12)個
Problem p02948 (python)

Fixed submission:
N,M = input().split()
N,M = int(N),int(M)
f_start = [0 for i in range(N)]
A,B = [],[]
import heapq
for i in range(N):
    a,b = input().split()
    a,b = int(a),int(b)
    A.append(a)
    B.append(-b)
    
def add(q_,add_):
    for i in range(len(add_)):
        heapq.heappush(q_,add_[i])

def kouho(A,B,M):
    kouho_list = [[] for i in range(M+1)]
    for i in range(len(A)):
        if(A[i]<=M):
            kouho_list[A[i]].append(B[i])
    return kouho_list

q = []
heapq.heapify(q)
sum_money = 0

kouho_list = kouho(A,B,M)
for m in range(1,M+1):
    kouho_ = kouho_list[m]
    add(q,kouho_)
    #print(q)
    if(len(q)>0):
        sum_money += -heapq.heappop(q)
print(sum_money)

Buggy submission (verdict: Runtime Error):
N,M = input().split()
N,M = int(N),int(M)
f_start = [0 for i in range(N)]
A,B = [],[]
for i in range(N):
    a,b = input().split()
    a,b = int(a),int(b)
    A.append(a)
    B.append(-b)
    
def add(q_,add_):
    for i in range(len(add_)):
        heapq.heappush(q_,add_[i])

def kouho(A,B,m):
    kouho_list = []
    for i in range(len(B)):
        if(A[i]==m):
            kouho_list.append(B[i])
    return kouho_list

q = []
heapq.heapify(q)
sum_money = 0

for m in range(1,M+1):
    kouho_list = kouho(A,B,m)
    add(q,kouho_list)
    #print(q)
    if(len(q)>0):
        sum_money += -heapq.heappop(q)
print(sum_money)

Buggy submission (verdict: Runtime Error):
#f:やったことのある仕事=1そうでない=0
N,M = input().split()
N,M = int(N),int(M)
f_start = [0 for i in range(N)]
A,B = [],[]
for i in range(N):
    a,b = input().split()
    a,b = int(a),int(b)
    A.append(a)
    B.append(b)
    
def dp(m,f):
    if(m==0):
        return 0
    else:
        max_ = 0
        for i in range(len(A)):
            if(f[i] == 0 and A[i]<=m):
                f_co = f.copy()
                f_co[i] = 1
                max_ = max([max_,dp(m-1,f_co)+B[i]])
        
        return max_
    
print(dp(M,f_start))
Problem p02951 (python)

Fixed submission:
A,B,C = input().split()
A,B,C = int(A),int(B),int(C)

print(max([C-(A-B),0]))

Buggy submission (verdict: Runtime Error):
A,B,C = intput().split()
A,B,C = int(A),int(B),int(C)

print(max([C-(A-B),0])

Buggy submission (verdict: Runtime Error):
A,B,C = intput().split()
A,B,C = int(A),int(B),int(C)

print(C-(A-B))
Problem p02816 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# (a,b,c,d) -> (ab,bc,cd,da) と変換
# xor x で不変量になる

N = int(readline())

A = list(map(int,readline().split()))
B = list(map(int,readline().split()))

def convert(A):
    return [x ^ y for x,y in zip(A,A[1:])] + [A[-1] ^ A[0]]

C = convert(A); D = convert(B)

def Z_algorithm(S):
    # 共通接頭辞の長さを返す
    N=len(S)
    arr = [0]*N
    arr[0] = N
    i,j = 1,0
    while i<N:
        while i+j<N and S[j]==S[i+j]:
            j += 1
        arr[i]=j
        if not j:
            i += 1
            continue
        k = 1
        while i+k<N and k+arr[k]<j:
            arr[i+k] = arr[k]
            k += 1
        i += k; j -= k
    return arr

Z = Z_algorithm(D + [-1] + C + C)[N+1:N+N+1]

K = [i for i,x in enumerate(Z) if x == N]
X = [A[k] ^ B[0] for k in K]

print('\n'.join('{} {}'.format(k,x) for k,x in zip(K,X)))

Buggy submission (verdict: Runtime Error):

Copy
Copy
a  = int(input())
if a == 2:
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())
    print()
elif a == 3:
    a1, a2, a3 = map(int, input().split())
    b1, b2, b3 = map(int, input().split())
    print(1,3)
elif a == 5:
    a1, a2, a3, a4, a5 = map(int, input().split())
    b1, b2, b3, b4, b5 = map(int, input().split())
    print(a1,a2)
    print(a1+1,a2)
    print(a1+2,a2)
    print(a1+3,a2)
    print(a1+4,a2)
elif a == 6:
    a1, a2, a3, a4, a5, a6 = map(int, input().split())
    b1, b2, b3, b4, b5, b6 = map(int, input().split())
    print(2,2)
    print(5,5)
Problem p02879 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]
if a <= 9 and b <= 9:
  print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
def prod(n):
  result = 1
  for x in n:
    result *= x
  return result
  
a = prime_factorize(n)
b = [a.pop(-1)]

while prod(a) > prod(b):
  prev_result = prod(a) + prod(b)
  b.append(a.pop(0))

  if prev_result < prod(a) + prod(b):
    a.append(b.pop(-1))
    break
  
print(prod(a)-1 +prod(b)-1)
Problem p02880 (python)

Fixed submission:
n = int(input())
if n <= 81:
  for i in range(1, 10):
    if n%i == 0:
      for j in range(1, 10):
        if (n/i)%j == 0 and (n/i)/j == 1:
          print("Yes")
          exit()
print("No")

Buggy submission (verdict: Runtime Error):
if n <= 81:
  for i in range(1, 10):
    if n%i == 0:
      for j in range(1, 10):
        if (n/i)%j == 0 and (n/i)/j == 1:
          print("Yes")
          exit()

print("No")

Buggy submission (verdict: Runtime Error):
if n <= 81:
  for i in range(1, 10):
    if n%i == 0:
      for j in range(1, 10):
        if (n/i)%j == 0 and (n/i)/j == 1:
          print("Yes")
          exit()

print("No")
Problem p02881 (python)

Fixed submission:
n = int(input())

ans = 1e18
for i in range(1, n):
	if i**2 > n:
		break
	if (n%i)== 0:
		j = n/i
		ans = int(min(ans, i+j-2))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
def prod(n):
  result = 1
  for x in n:
    result *= x
  return result
  
a = prime_factorize(n)
b = [a.pop(-1)]

while prod(a) > prod(b) and len(a) > 1:
  prev_result = prod(a) + prod(b)
  b.append(a.pop(a.min()))

try:
  if prev_result < prod(a) + prod(b) and len(b) > 1:
    a.append(b.pop(b.min()))

except:
  pass
print(prod(a)-1 +prod(b)-1)

Buggy submission (verdict: Runtime Error):
n = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
def prod(n):
  result = 1
  for x in n:
    result *= x
  return result
  
a = prime_factorize(n)
b = [a.pop(-1)]


while prod(a) > prod(b):
  prev_result = prod(a) + prod(b)
  b.append(a.pop(a.min()))


try:
  if prev_result < prod(a) + prod(b):
    a.append(b.pop(b.min()))


except:
  pass
print(prod(a)-1 +prod(b)-1)

Buggy submission (verdict: Runtime Error):

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
def prod(n):
  result = 1
  for x in n:
    result *= x
  return result
  
a = prime_factorize(n)
b = [a.pop(-1)]


while prod(a) > prod(b):
  prev_result = prod(a) + prod(b)
  b.append(a.pop(0))

try:
  if prev_result < prod(a) + prod(b):
    a.append(b.pop(-1))

except:
  pass
print(prod(a)-1 +prod(b)-1)

Buggy submission (verdict: Runtime Error):

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
def prod(n):
  result = 1
  for x in n:
    result *= x
  return result
  
a = prime_factorize(n)
b = [a.pop(-1)]

while prod(a) > prod(b):
  prev_result = prod(a) + prod(b)
  b.append(a.pop(0))

  if prev_result < prod(a) + prod(b):
    a.append(b.pop(-1))
    break
  
print(prod(a)-1 +prod(b)-1)
Problem p02835 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a+b+c >= 22:
  	print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
inputs = []
for x in range 3:
    inputs.append(input("Input: "))
indices = [0,2]
if(a[indices].sum() >= 22):
    print("bust")
    else print("win")
Problem p02829 (python)

Fixed submission:
a = input("")
b = input("")

a = int(a)
b = int(b)

print(6-a-b)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()

ans={1,2,3}
ans.remove(a)
ans.remove(b)

if ans == {a}
    print("a")
if ans == {b}
    print("b")
if ans == {c}
    print("c")

Buggy submission (verdict: Runtime Error):
a=input()
b=input()

ans={1,2,3}
ans.remove(a)
ans.remove(b)
print(ans)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
c = a + b

if c == 3:
  print('3')
elif c == 4:
  print('2')
else:
  print('1')

Buggy submission (verdict: Runtime Error):
S = []
for _ in range(2):
    S.append(input())

if S == [1, 2]
  print('3')
elif S == [1, 3]:
  print('2')
elif S == [2, 3]:
  print('1')

Buggy submission (verdict: Runtime Error):
S = []
for _ in range(2):
    S.append(input())

if S == [1, 2]
  print('3')
elif S == [2, 1]:
  print('3')
elif S == [1, 3]:
  print('2')
elif S == [3, 1]:
  print('2')
elif S == [2, 3]:
  print('1')
elif S == [3, 2]:
  print('1')
Problem p02859 (python)

Fixed submission:
a = int(input())
a = a*a
print(a)

Buggy submission (verdict: Runtime Error):
a=input()
print(a*a)
Problem p02915 (python)

Fixed submission:
n = int(input())
print(n*n*n)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
a = [int(i) for i in a]
b = input().split()
b = [int(i) for i in b]
result= 0
for i in range (n):
  result += b[i]
c = input().split()
c = [int(i) for i in c]
for i in range (n):
  if a[i] - a[i-1] == 1:
    result += c[i-2]
  else:
    break
print(result)
Problem p02829 (python)

Fixed submission:
A = int(input())
B = int(input())

figure = [1, 2, 3]

if 1 != A and 1 != B:
  print(1)
elif 2 != A and 2 !=B:
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

figure = [1, 2, 3]

print(if figure != A or B)
Problem p02819 (python)

Fixed submission:
import sys
input = sys.stdin.readline
X = int(input())

max_n = 100003
primes = [True] * (max_n+1)

for i in range(2,max_n+1):
  if primes[i] == True:
    if i >= X:
      print(i)
      break
    for j in range(i+i, max_n+1, i):
      primes[j] = False

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input().rstrip()
# if (i)th == (i-K)th: point=0
for i in range(K+K,N):
  if T[i] == T[i-K]:
    T[i] = 'o'

point = 0
for t in T:
  if t == 'r':
    point += P
  elif t == 's':
  	point += R
  elif p == 'p':
    point += S

print(point)
Problem p02897 (python)

Fixed submission:
N = int(input())

if N%2==0:
    print(1/2)
else:
    print((N+1)/(N*2))

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%2==0:
    print(1/2)
else:
    print((a+1)/(a*2))

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%2==0:
    print(1/2)
else:
    print((a+1)/a*2)
Problem p02862 (python)

Fixed submission:
X,Y=map(int,input().split())
A,B=1,1
mod=10**9+7
if (X+Y)%3 ==0:
    x=(2*Y-X)//3
    y=(2*X-Y)//3
    if min(x,y) >= 0:
      for i in range(min(x,y)):
        A*=(x+y-i)
        A%=mod
        B*=(i+1)
        B%=mod
      print(A*pow(B,mod-2,mod)%mod)
    else:
      print(0)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().spilt())
mult1=1
mult2=1
if (2*Y-X)%3 ==0:
    x=(2*Y-X)//3
    y=(2*X-Y)//3
    for i in range(min(x,y)):
        mult1*=(x+y-i)
        mult2*=min(x,y)-i
    print((mult2//mult1)%(10**9+7))
else:
    print(0)
Problem p02897 (python)

Fixed submission:
N=int(input())
if int((N+1)/2) == int(N/2):
  p=float(0.50000000)
else:
  p=float((N+1)/(2*N))
print(p)

Buggy submission (verdict: Runtime Error):
N=int(input())
if (N+1)/2 == N/2:
  p=float(0.5000000)
else:
  p=float((N-1)/2N)
print(p)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N = N/2:
  p=float(0.5000000)
else:
  p=float((N-1)/2N)
print(p)
Problem p02990 (python)

Fixed submission:
import math

str=input()
n,k=int(str.split()[0]),int(str.split()[1])

def place(n,x):
    if n==1:
        return 1
    ans=1
    if n-1 < x:
        for i in range(x+1,n+x):
            ans*=i
        ans//=math.factorial(n-1)
    else:
        for i in range(n, n+x):
            ans*=i
        ans//=math.factorial(x)
    return ans%1000000007


for i in range (1,k+1):
    if n-k < i-1:
        print(0)
    else:
        cb=place(  i,  k-i  )
        cr=place(i+1,n-k-i+1)
        cr=cr%1000000007
        print(cb*cr%1000000007)

Buggy submission (verdict: Runtime Error):
import math

str=input()
n,k=int(str.split()[0]),int(str.split()[1])

def place(n,x):
    if n==1:
        return 1
    ans=1
    if n-1 < x:
        for i in range(x+1,n+x):
            ans*=i
        ans//=math.factorial(n-1)
    else:
        for i in range(n, n+x):
            ans*=i
        ans//=math.factorial(x)
    return ans%1000000007


for i in range (1,k+1):
    if i > (n+1)//2:
        print(0)
    else:
        cb=place(  i,  k-i  )
        cr=place(i+1,n-k-i+1)
        cr=cr%1000000007
        print(cb*cr%1000000007)

Buggy submission (verdict: Runtime Error):
import math

str=input()
n,k=int(str.split()[0]),int(str.split()[1])

def place(n,x):
    if n==1:
        return 1
    ans=1
    if n-1 < x:
        for i in range(x+1,n+x):
            ans*=i
        ans//=math.factorial(n-1)
    else:
        for i in range(n, n+x):
            ans*=i
        ans//=math.factorial(x)
    return ans%1000000007

for i in range (1,k+1):
    cb=place(  i,  k-i  )
    cr=place(i+1,n-k-i+1)
    print(cb*cr%1000000007)

Buggy submission (verdict: Runtime Error):
import math

str=input()
n,k=int(str.split()[0]),int(str.split()[1])

def place(n,x):
    if n<1:
        return 0
    if n==1:
        return 1
    return int( math.factorial(n+x-1)/math.factorial(n-1)/math.factorial(x) % 1000000007)

for i in range (1,k+1):
    cb=place(  i,  k-i  )
    cr=place(i+1,n-k-i+1)
    cr=cr%1000000007
    print(cb*cr%1000000007)

Buggy submission (verdict: Runtime Error):
import math

str=input()
n,k=int(str.split()[0]),int(str.split()[1])

def place(n,x):
    if n<1:
        return 0
    if n==1:
        return 1
    return ( math.factorial(n+x-1)//math.factorial(n-1)//math.factorial(x) % 1000000007)

for i in range (1,k+1):
    cb=place(  i,  k-i  )
    cr=place(i+1,n-k-i+1)
    cr=cr%1000000007
    print(cb*cr%1000000007)

Buggy submission (verdict: Runtime Error):
import math

str=input()
n,k=int(str.split()[0]),int(str.split()[1])

def place(n,x):
    if n<1:
        return 0
    if n==1:
        return 1
    return ( math.factorial(n+x-1)//math.factorial(n-1)//math.factorial(x) % 1000000007)

for i in range (1,k+1):
    cb=place(  i,  k-i  )
    cr=place(i+1,n-k-i+1)
    cr=cr%1000000007
    print(cb*cr%1000000007)