Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
print((lambda a,b,c: "YES" if a<=c&&c<=b else "NO")(*[int(_) for _ in input().split()]))

Fixed submission:
print((lambda a,b,c: "Yes" if a<=c and c<=b else "No")(*[int(_) for _ in input().split()]))
Buggy python submission (verdict: Time Limit Exceeded):
a, b ,c = map(int,input().split(" "))
ap =[]
ap = list(map(int,input().split(" ")))
bp =[]
bp = list(map(int,input().split(" ")))
lowest = 10000000
for i in ap:
    for j in bp:
        lowest = min(lowest,i+j)
for _ in range(c):
    x, y ,z = map(int,input().split(" "))
    dis = ap[x-1] + bp[y-1] - z
    lowest = min(lowest,dis)
print(lowest)

Fixed submission:
a, b ,c = map(int,input().split(" "))
ap =[]
ap = list(map(int,input().split(" ")))
bp =[]
bp = list(map(int,input().split(" ")))
lowest = 10000000
ma = min(ap)
mb = min(bp)
lowest = ma +mb
for _ in range(c):
    x, y ,z = map(int,input().split(" "))
    dis = ap[x-1] + bp[y-1] - z
    lowest = min(lowest,dis)
print(lowest)
Buggy python submission (verdict: Runtime Error):
from collections import deque
 
s = input()
q = int(input())
ans = deque(s)
cnt = 0
for i in range(q):
    f = [i for i in input().split()]
    if f[0] == '1':
        cnt += 1
    else:
        if f[1] == '1':
            if cnt % 2 == 0:
                ans.appendleft(f[2])
            else:

Fixed submission:
from collections import deque
 
s = input()
q = int(input())
ans = deque(s)
cnt = 0
for i in range(q):
    f = [i for i in input().split()]
    if f[0] == '1':
        cnt += 1
    else:
        if f[1] == '1':
            if cnt % 2 == 0:
                ans.appendleft(f[2])
            else:
                ans.append(f[2])
        else:
            if cnt % 2 == 0:
                ans.append(f[2])
            else:
                ans.appendleft(f[2])
if cnt % 2 != 0:
    ans.reverse()
print(''.join(map(str,ans)))
Buggy python submission (verdict: Runtime Error):
def solve(pick, idx):

    if pick == 0: return 0
    if idx >= n: return -float('inf')
    if (pick, idx) in dp: return dp[pick, idx]
    if n-idx+2 < pick*2: return -float('inf')
    total = max(A[idx] + solve(pick-1, idx+2), solve(pick, idx+1))

    dp[(pick, idx)] = total
    return total

n = int(input())
A = list(map(int, input().split()))
dp = {}
pick = n//2

print(solve(pick, 0))
"""
@lru_cache(None)
def F(index, n):
    if index >= N:
        return -INF
    if N - index + 2 < 2 * n:
        return -INF
    if n == 0:
        return 0
    elif n == 1:
        return max(A[index:])
    ret = max(A[index] + F(index+2, n-1), F(index+1, n))
    return ret
"""

Fixed submission:
ans = ['No', 'Yes']
print( ans['7' in input()])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_l = list(map(int, input().split()))
a_d = {}
for i, p in enumerate(a_l):
    a_d[p] = i
res_l = []
for k in sorted(list(a_d.keys())):
    res_l.append(str(a_dt[k]+1))
print(' '.join(res_l))

Fixed submission:
n = int(input())
p_list = list(map(int, input().split()))
p_dict = {}
for i, p in enumerate(p_list):
    p_dict[p] = i
res_list = []
for key in sorted(list(p_dict.keys())):
    res_list.append(str(p_dict[key]+1))
print(' '.join(res_list))
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

count = 0
for i in range(1000):
    if S[i] == T[i]:
        count += 1
print(count)

Fixed submission:
S = input()
T = input()

count = 0
for i in range(3):
    if S[i] == T[i]:
        count =count + 1
print(count)

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

count = 0
for i in range(1000):
    if S[i] == T[i]:
        cnt += 1
print(count)

Fixed submission:
S = input()
T = input()

count = 0
for i in range(3):
    if S[i] == T[i]:
        count =count + 1
print(count)
Buggy python submission (verdict: Runtime Error):
#El Patron
A = int(input())
B = list(map(int, input().split()))

a = 0
b = 0
ans = 0
while b < A:
    if b < A - 1 and B[b + 1] <= B[b]:
        b += 1
        res = max(res, b - l)
    elif b != a:
        a += 1
    else:
        a += 1
        b += 1
print(res)

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

a = 0
b = 0
res = 0
while a < A:
    if a < A - 1 and B[a + 1] <= B[a]:
        a += 1
        res = max(res, a - b)
    elif a != b:
        b += 1
    else:
        b += 1
        a += 1
print(res)

Buggy python submission (verdict: Runtime Error):
#El Patron
A = int(input())
B = list(map(int, input().split()))

a = 0
b = 0
ans = 0
while b < A:
    if b < A - 1 and B[b + 1] <= B[b]:
        b += 1
        res = max(res, b - l)
    elif b != l:
        a += 1
    else:
        a += 1
        b += 1
print(res)

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

a = 0
b = 0
res = 0
while a < A:
    if a < A - 1 and B[a + 1] <= B[a]:
        a += 1
        res = max(res, a - b)
    elif a != b:
        b += 1
    else:
        b += 1
        a += 1
print(res)
Buggy python submission (verdict: Runtime Error):
#El Patron
S = list(input())

pre_list = []
tar_list = [S[0]]
count = 1
a = 1
try:
	while a < len(S):
		pre_list = tar_list 
		tar_list = []
		tar_list.append(S[i])
		a += 1
	
		while tar_list == pre_list:
			tar_list.append(S[i])
			a += 1
	
		count += 1

except IndexError:
	pass
print(count)


Fixed submission:
S = list(input())

pre_list = []
tar_list = [S[0]]
count = 1
i = 1
try:
	while i < len(S):
		pre_list = tar_list 
		tar_list = []
		tar_list.append(S[i])
		i += 1
		
		while tar_list == pre_list:
			tar_list.append(S[i])
			i += 1
	
		count += 1

except IndexError:
	pass
print(count)

Buggy python submission (verdict: Runtime Error):
#El Patron
S = list(input())

pre_list = []
tar_list = [S[0]]
count = 1
a = 1
try:
	while a < len(S):
		pre_list = tar_list 
		tar_list = []
		tar_list.append(S[i])
		a += 1
	
		while tar_list == pre_list:
			tar_list.append(S[i])
			a += 1
	
		count += 1

except IndexError:
	pass
print(count)

Fixed submission:
S = list(input())

pre_list = []
tar_list = [S[0]]
count = 1
i = 1
try:
	while i < len(S):
		pre_list = tar_list 
		tar_list = []
		tar_list.append(S[i])
		i += 1
		
		while tar_list == pre_list:
			tar_list.append(S[i])
			i += 1
	
		count += 1

except IndexError:
	pass
print(count)
Buggy python submission (verdict: Runtime Error):
 l = [int(x) for x in input().split()]

if l[0] == 7 or l[1] == 7 or l[2] == 7:
    print('YES')
else:
    print('NO')

Fixed submission:
s = input() 
l = [int(x) for x in s]

if l[0] == 7 or l[1] == 7 or l[2] == 7:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
flip = 0
for i in range(Q):
    query = input()
    if query == str(1):
        flip += 1
    else:
        f = int(query[2])
        c = query[-1]
        if f == 1:
            if flip%2 == 1:
                S = S + c
            else:
                S = c + S
        else:
            if flip%2 == 1:
                S = c + S
            else:
                S = S + c
if flip%2 == 1:
    print(S[::-1])
else:
    print(S)

Fixed submission:
from collections import deque
X = input()
S = deque()
for e in X:
    S.append(e)
Q = int(input())
flip = 0
for i in range(Q):
    query = input()
    if query == str(1):
        flip += 1
    else:
        f = int(query[2])
        c = query[-1]
        if f == 1:
            if flip%2 == 1:
                S.append(c)
            else:
                S.appendleft(c)
        else:
            if flip%2 == 1:
                S.appendleft(c)
            else:
                S.append(c)
S = "".join(S)
if flip%2 == 1:
    print(S[::-1])
else:
    print(S)
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
mod = 10**9+7
X = 200000
inv_t = [0]+[1]
for i in range(2,X):
  inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

def fast_mod_pow(x, n, mod):
    r = 1
    while n>0:
        if n&1:
            r = (r * x) % mod
        x = (x * x) % mod
        n >>= 1
    return r

def comb(n,k):
    value = 1
    for i in range(n-k+1,n+1):
        value *= i
        value %= mod
    for i in range(1,k+1):
        value *= inv_t[i]
        value %= mod
    return value

ans = fast_mod_pow(2,N,mod)-1
ans -= comb(N,A)
ans -= comb(N,B)
print(ans%mod)

Fixed submission:
N,A,B = map(int,input().split())
mod = 10**9+7
X = 210000
inv_t = [0]+[1]
for i in range(2,X):
  inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

def fast_mod_pow(x, n, mod):
    r = 1
    while n>0:
        if n&1:
            r = (r * x) % mod
        x = (x * x) % mod
        n >>= 1
    return r

def comb(n,k):
    value = 1
    for i in range(n-k+1,n+1):
        value *= i
        value %= mod
    for i in range(1,k+1):
        value *= inv_t[i]
        value %= mod
    return value

ans = fast_mod_pow(2,N,mod)-1
ans -= comb(N,A)
ans -= comb(N,B)
print(ans%mod)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input())
if N == M:
    print('Yes')
else:
    print('No')

Fixed submission:
N,M = map(int,input().split())
if N == M:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
mod = 10**9 + 7
m = 62
d =[0]*m
ans = 0
for i in range(N):
    for j in range(m):
        if A[i]&(1<<j):
            ans += (1<<j)*(i-d[j])%mod
            d[j] += 1
        else:
            ans += (1<<j)*d[j]%mod
    ans %= mod
print(ans%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
mod = 10**9 + 7
m = 62
d =[0]*m
ans = 0
for i in range(N):
    for j in range(m):
        if A[i]&(1<<j):
            ans += (1<<j)*(i-d[j])%mod
            d[j] += 1
        else:
            ans += (1<<j)*d[j]%mod
    ans %= mod
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
mod = 10**9 + 7
m = 62
d =[0]*m
ans = 0
for i in range(N):
    for j in range(m):
        if A[i]&(1<<j):
            ans += (1<<j)*(i-d[j])
            d[j] += 1
        else:
            ans += (1<<j)*d[j]
    ans %= mod
print(ans%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
mod = 10**9 + 7
m = 62
d =[0]*m
ans = 0
for i in range(N):
    for j in range(m):
        if A[i]&(1<<j):
            ans += (1<<j)*(i-d[j])%mod
            d[j] += 1
        else:
            ans += (1<<j)*d[j]%mod
    ans %= mod
print(ans%mod)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
ans = 0
for i in range(1000):
    e = str(i).zfill(3)
    c = 0
    for s in S:
        if s == e[c]:
            c += 1
            if c == 3:
                ans += 1
                break
print(ans)

Fixed submission:
N = int(input())
S = input()
ans = 0
for i in range(1000):
    e = str(i).zfill(3)
    c = 0
    for s in S:
        if s == e[c]:
            c += 1
            if c == 3:
                ans += 1
                break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int,input().split()))
ans = 0
for i in range(N):
    for j in range(i):
        for k in range(j):
            if L[i] < L[j]+L[k] and L[j] < L[i]+L[k] and L[k] < L[i]+L[j]:
                ans += 1
print(ans)

Fixed submission:
from bisect import bisect_right, bisect_left

N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0

for i in range(N-2):
    for j in range(i+1,N-1):
        a = L[i]
        b = L[j]
        left = abs(a-b)
        right = a+b
        q = max(j+1,bisect_left(L,right))
        w = max(j+1,bisect_right(L,left))
        ans += q-w
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

import sys
input = sys.stdin.readline
N,M = map(int,input().split())
A = []
C = []

for i in range(M):
    A.append(int(input().split()[0]))
    C.append(list(map(int,input().split())))

import numpy as np


inf = 1000000000
dp = np.zeros(2**N).astype('int')

dp[:] = inf
dp[0] = 0


for i in range(M):
    cost = A[i]
    candidate = C[i]
    mask = 0
    for c in candidate:
        mask += 1 << (c-1)
    for j in range(2**N):
        if dp[j|mask] > dp[j] + cost:
            dp[j|mask] = dp[j] + cost


if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])


Fixed submission:

import sys
input = sys.stdin.readline
N,M = map(int,input().split())
A = []
C = []

for i in range(M):
    A.append(int(input().split()[0]))
    C.append(list(map(int,input().split())))


inf = 1000000000
dp = [inf for _ in range(2**N)]
dp[0] = 0

for i in range(M):
    cost = A[i]
    candidate = C[i]
    mask = 0
    for c in candidate:
        mask += 1 << (c-1)
    for j in range(2**N):
        if dp[j|mask] > dp[j] + cost:
            dp[j|mask] = dp[j] + cost

if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
A = []
C = []

for i in range(M):
    A.append(int(input().split()[0]))
    C.append(list(map(int,input().split())))

import numpy as np


inf = 1000000000
dp = np.zeros(2**N).astype('int')

dp[:] = inf
dp[0] = 0


for i in range(M):
    cost = A[i]
    candidate = C[i]
    mask = 0
    for c in candidate:
        mask += 1 << (c-1)
    for j in range(2**N):
        if dp[j|mask] > dp[j] + cost:
            dp[j|mask] = dp[j] + cost


if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])


Fixed submission:

import sys
input = sys.stdin.readline
N,M = map(int,input().split())
A = []
C = []

for i in range(M):
    A.append(int(input().split()[0]))
    C.append(list(map(int,input().split())))


inf = 1000000000
dp = [inf for _ in range(2**N)]
dp[0] = 0

for i in range(M):
    cost = A[i]
    candidate = C[i]
    mask = 0
    for c in candidate:
        mask += 1 << (c-1)
    for j in range(2**N):
        if dp[j|mask] > dp[j] + cost:
            dp[j|mask] = dp[j] + cost

if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, M = map(int,input().split())
As = list(map(int,input().split()))

As = sorted(As,reverse=True)
M_allocation = [0 for _ in range(N)]


argmax = 0
for i in range(M):
    As[argmax] = As[argmax]//2
    argmax =  np.argmax(As)
print(sum(As))






Fixed submission:
import heapq

N, M = map(int,input().split())
As = list(map(int,input().split()))
As = [-1*e for e in As]
heapq.heapify(As)
for i in range(M):
    value = -heapq.heappop(As)
    heapq.heappush(As,-(value//2))
print(-sum(As))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
S = input()

def z_arr(s):
    Z = [0] * len(s)
    Z[0] = len(s)

    rt = 0
    lt = 0

    for k in range(1, len(s)):
        if k > rt:
            # If k is outside the current Z-box, do naive computation.
            n = 0
            while n + k < len(s) and s[n] == s[n+k]:
                n += 1
            Z[k] = n
            if n > 0:
                lt = k
                rt = k+n-1
        else:
            # If k is inside the current Z-box, consider two cases.

            p = k - lt  # Pair index.
            right_part_len = rt - k + 1

            if Z[p] < right_part_len:
                Z[k] = Z[p]
            else:
                i = rt + 1
                while i < len(s) and s[i] == s[i - k]:
                    i += 1
                Z[k] = i - k

                lt = k
                rt = i - 1
    return Z

ans = 0
for i in range(len(S)):
    x = z_arr(S[i:])
    for j,e in enumerate(x):
        remain_length = len(S[i:])-e
        if remain_length >= e:
            if e > ans:
                ans = e

print(ans)



Fixed submission:
n = int(input())
s = input()
def output():
    left, right = 0, n//2+1
    while left < right-1:
        mid = (left+right)//2
        if check(mid):
            left = mid
        else:
            right = mid
    return left
def check(x):
    hashes = set()
    for i in range(n - 2*x + 1):
        hashes.add(s[i: i+x])
        if s[i+x: i+2*x] in hashes:
            return True
    return False
print(output())

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
S = input()

def z_arr(s):
    Z = [0] * len(s)
    Z[0] = len(s)

    rt = 0
    lt = 0

    for k in range(1, len(s)):
        if k > rt:
            # If k is outside the current Z-box, do naive computation.
            n = 0
            while n + k < len(s) and s[n] == s[n+k]:
                n += 1
            Z[k] = n
            if n > 0:
                lt = k
                rt = k+n-1
        else:
            # If k is inside the current Z-box, consider two cases.

            p = k - lt  # Pair index.
            right_part_len = rt - k + 1

            if Z[p] < right_part_len:
                Z[k] = Z[p]
            else:
                i = rt + 1
                while i < len(s) and s[i] == s[i - k]:
                    i += 1
                Z[k] = i - k

                lt = k
                rt = i - 1
    return Z

ans = 0
for i in range(len(S)):
    x = z_arr(S[i:])
    for j,e in enumerate(x):
        remain_length = len(S[i:])-e
        if remain_length >= e:
            if e > ans:
                ans = e

print(ans)



Fixed submission:
n = int(input())
s = input()
def output():
    left, right = 0, n//2+1
    while left < right-1:
        mid = (left+right)//2
        if check(mid):
            left = mid
        else:
            right = mid
    return left
def check(x):
    hashes = set()
    for i in range(n - 2*x + 1):
        hashes.add(s[i: i+x])
        if s[i+x: i+2*x] in hashes:
            return True
    return False
print(output())
Buggy python submission (verdict: Runtime Error):
N = int(input())
Hs = list(map(int,input().split()))


count = 0
counts = []
for i in reversed(range(1,N)):
    if Hs[i-1] >= Hs[i]:
        count += 1
    else:
        counts.append(count)
        count = 0

print(max(counts))


Fixed submission:
N = int(input())
Hs = list(map(int,input().split()))


count = 0
counts = []
max_count = 0
for i in reversed(range(1,N)):
    if Hs[i-1] >= Hs[i]:
        count += 1
    else:
        if max_count < count:
            max_count = count
        count = 0
if count > max_count:
    print(count)
else:
    print(max_count)
Buggy python submission (verdict: Runtime Error):
import math
import sys
from copy import copy
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)

n = int(input())
s = list(input())

count = 0


if s[0] == 'W' or s[-1] == 'W':
    print(0)
    sys.exit()

LR_list = ['' for i in range(2*n)]
LR_list[0] = 'L'

for i in range(1,len(LR_list)):
    if s[i] == s[i-1]:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'L'
        else:
            LR_list[i] = 'R'
    else:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'R'
        else:
            LR_list[i] = 'L'

values = []

if LR_list.count('L') != LR_list.count('R'):
    print(0)
    sys.exit()
for i in range(len(LR_list)):
    if LR_list[i] == 'R':
        li = LR_list[:i].count('L')
        ri = LR_list[:i].count('R')
        values.append(li-ri)
print(np.array(values).prod()*math.factorial(n))



Fixed submission:
import math
import sys
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)

m, d = map(int,input().split())

count = 0
for i in range(1,m+1):
    for j in range(10,d+1):
        first_d = int(str(j)[1])
        second_d = int(str(j)[0])
        if i == first_d * second_d and first_d >= 2 and second_d >= 2:
            count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
S = input()
dp = np.zeros((len(S)+1,13)).astype('int')
dp[0][0] = 1
for i in range(len(S)):
    if S[i] == '?':
        c = -1
    else:
        c = int(S[i])
    for j in range(10):
        if c != -1 and c != j:
            continue
        for k in range(13):
            dp[i+1][(k*10+j)%13] += dp[i][k]
    for j in range(13):
        dp[i+1][j] %= int(10**9 + 7)
print(dp[len(S)][5])

Fixed submission:
S = input()
mod = 10**9 + 7
dp = [[0 for i in range(13)] for j in range(len(S)+1)]
dp[0][0] = 1
for i in range(len(S)):
    if S[i] == '?':
        c = -1
    else:
        c = int(S[i])
    for j in range(10):
        if c != -1 and c != j:
            continue
        for k in range(13):
            dp[i+1][(k*10+j)%13] += dp[i][k]%mod
    for j in range(13):
        dp[i+1][j] %= 10**9 + 7
print(dp[len(S)][5]%mod)
Buggy python submission (verdict: Runtime Error):
r = int(input())
print(3*a*a)

Fixed submission:
r = int(input())
print(3*r*r)
Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
N, K = map(int,input().split())

for i in range(1,K+1):
    c1 = comb(K-1,i-1)
    c2 = comb(N-K+1,i)
    print(int((c1*c2)%(1000000000+7)))



Fixed submission:
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
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
Z = 2000

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

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

for i in range(1,K+1):
    c1 = cmb(K-1,i-1,mod)
    c2 = cmb(N-K+1,i,mod)
    print(int((c1*c2)%(1000000000+7)))

Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N, K = map(int,input().split())
for i in range(1,K+1):
    c1 = comb(K-1,i-1)
    c2 = comb(N-K+1,i)
    print(int((c1*c2)%(1000000000+7)))



Fixed submission:
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
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
Z = 2000

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

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

for i in range(1,K+1):
    c1 = cmb(K-1,i-1,mod)
    c2 = cmb(N-K+1,i,mod)
    print(int((c1*c2)%(1000000000+7)))

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
N, K = map(int,input().split())
for i in range(1,K+1):
    c1 = comb(K-1,i-1)
    c2 = comb(N-K+1,i)
    print(int((c1*c2)%(1000000000+7)))



Fixed submission:
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
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
Z = 2000

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

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

for i in range(1,K+1):
    c1 = cmb(K-1,i-1,mod)
    c2 = cmb(N-K+1,i,mod)
    print(int((c1*c2)%(1000000000+7)))