Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# coding:utf-8
x, n = map(int, input().split())
p = list(map(int, input().split()))


if n == 0:
    print(x)
else:
    ps = sorted(p)
    tmp = [_ for _ in range(ps[0], ps[-1] + 1)]
    ans_list = list(set(tmp) ^ set(ps))
    # print(tmp, ans_list)
    diff = []

    for i in ans_list:
        diff.append(abs(i - x))
    print(ans_list[diff.index(min(diff))])


Fixed submission:
# coding:utf-8
x, n = map(int, input().split())
p = list(map(int, input().split()))


if n == 0:
    print(x)
else:
    ps = sorted(p)
    tmp = list(range(-201, 200))
    ans_list = list(set(tmp) ^ set(ps))
    ans_list = sorted(ans_list)
    # print(tmp, ans_list)
    diff = []

    for i in ans_list:
        diff.append(abs(i - x))

    print(ans_list[diff.index(min(diff))])
Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
count = [0 for _ in range(max(a) + 1)]
ans = 0

for i in a:
    if count[i] != 0:
        count[i] = 1
        continue
    for j in range(2 * i, max(a) + 1, i):
        count[j] = 1
    count[i] = 2

for i in a:
    if count[i] != 1:
        ans += 1

print(ans)


Fixed submission:
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
m = max(a)
count = [0 for _ in range(m + 1)]
ans = 0

for i in a:
    if count[i] != 0:
        count[i] = 1
        continue
    for j in range(2 * i, m + 1, i):
        count[j] = 1
    count[i] = 2

for i in a:
    if count[i] != 1:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
count = [0] * (max(a) + 1)
ans = 0

for i in a:
    if count[i] != 0:
        count[i] = 1
        continue
    for j in range(2 * i, max(a) + 1, i):
        count[j] = 1
    count[i] = 2

for i in a:
    if count[i] != 1:
        ans += 1

print(ans)


Fixed submission:
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
m = max(a)
count = [0 for _ in range(m + 1)]
ans = 0

for i in a:
    if count[i] != 0:
        count[i] = 1
        continue
    for j in range(2 * i, m + 1, i):
        count[j] = 1
    count[i] = 2

for i in a:
    if count[i] != 1:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
ans = 1

for i in range(n):
    ans = ans * a[i]

if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
ans = 1

if 0 in a:
    print(0)
    exit()

for i in range(n):
    ans = ans * a[i]
    if ans > 10**18:
        print(-1)
        exit()

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8
def main():
    import math

    a, b, n = map(int, input().split())
    ans = 0

    for x in range(n, 0, -1):
        tmp = math.floor((a * x) / b) - a * (math.floor(x / b))
        ans = max(tmp, ans)

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
# coding:utf-8

import math

a, b, n = map(int, input().split())
x = min(b - 1, n)

ans = math.floor((a * x) / b) - a * (math.floor(x / b))

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8
def main():
    import math

    a, b, n = map(int, input().split())
    ans = 0

    for x in range(1, n + 1):
        tmp = math.floor((a * x) / b) - a * (math.floor(x / b))
        ans = max(tmp, ans)

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
# coding:utf-8

import math

a, b, n = map(int, input().split())
x = min(b - 1, n)

ans = math.floor((a * x) / b) - a * (math.floor(x / b))

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8
import math

a, b, n = map(int, input().split())
ans = 0

for x in range(1, n + 1):
    tmp = math.floor((a * x) / b) - a * (math.floor(x / b))
    ans = max(tmp, ans)

print(ans)


Fixed submission:
# coding:utf-8

import math

a, b, n = map(int, input().split())
x = min(b - 1, n)

ans = math.floor((a * x) / b) - a * (math.floor(x / b))

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8
import math

a, b, n = map(int, input().split())
ans = 0

for x in range(1, n + 1):
    tmp = math.floor((a * x) / b) - a * (math.floor(x / b))
    ans = max(tmp, ans)

print(ans)


Fixed submission:
# coding:utf-8

import math

a, b, n = map(int, input().split())
x = min(b - 1, n)

ans = math.floor((a * x) / b) - a * (math.floor(x / b))

print(ans)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
import math
n, k = map(int, input().split())

if n < k:
    print(min(n, k%n))
elif k == 1 or n == 0 or n%k == 0:
    print(0)
elif k % 2 == 0 and n % 2 == 0 and n%k != 0:
    print(n%k)
elif n%k != 0:
    print(min(abs(n%k-k), n%k))


Fixed submission:
#coding:utf-8
import math
n, k = map(int, input().split())

if n < k:
    print(min(n, abs(n-k)))
elif k == 1 or n == 0 or n%k == 0:
    print(0)
elif n%k != 0:
    print(min(abs(n%k-k), n%k))

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
import math
n, k = map(int, input().split())

if n < k:
    print(n)
elif k == 1 or (k % 2 == 0 and n % 2 == 0):
    print(0)
elif (k % 2 == 0 and n % 2 == 1) or (n % 2 == 0 and l % 2 == 1):
    print(1)


Fixed submission:
#coding:utf-8
import math
n, k = map(int, input().split())

if n < k:
    print(min(n, abs(n-k)))
elif k == 1 or n == 0 or n%k == 0:
    print(0)
elif n%k != 0:
    print(min(abs(n%k-k), n%k))
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import itertools

k, n = map(int, input().split())
a = tuple(map(int, input().split()))
ans = 100000000000000000000

dist = []
pattern = sorted(list(itertools.permutations(a)))
#print(pattern)
#print(len(pattern))

for i in range(len(pattern)):
    tmp = 0
    for j in range(0,n-1):
        right = abs(pattern[i][j+1] - pattern[i][j])
        left = abs(k - pattern[i][j+1])
        #print(right, left)
        tmp += min(right, left)
    if tmp < ans:
        ans = tmp

#print(dist)
print(ans)

Fixed submission:
#coding:utf-8

k, n = map(int, input().split())
a = list(map(int, input().split()))
dist = []

#逆周りの方が距離が短く済むので、距離を2倍にして考える
#池の一周の長さ+a[0]を座標として追加
a.append(a[0] + k)

#距離が最大になる経路は通らないので除外する
for i in range(n):
    dist.append(a[i+1] - a[i])

#print(a, dist)
#池の一周の長さから、距離が最大になるところを除外したものが最短
print(k - max(dist))

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import itertools

k, n = map(int, input().split())
a = tuple(map(int, input().split()))

dist = []
pattern = sorted(list(itertools.permutations(a)))
#print(pattern)
#print(len(pattern))

for i in range(len(pattern)):
    tmp = 0
    for j in range(0,n-1):
        right = abs(pattern[i][j+1] - pattern[i][j])
        left = abs(k - pattern[i][j+1])
        #print(right, left)
        tmp += min(right, left)
    dist.append(tmp)

#print(dist)
print(min(dist))

Fixed submission:
#coding:utf-8

k, n = map(int, input().split())
a = list(map(int, input().split()))
dist = []

#逆周りの方が距離が短く済むので、距離を2倍にして考える
#池の一周の長さ+a[0]を座標として追加
a.append(a[0] + k)

#距離が最大になる経路は通らないので除外する
for i in range(n):
    dist.append(a[i+1] - a[i])

#print(a, dist)
#池の一周の長さから、距離が最大になるところを除外したものが最短
print(k - max(dist))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)


if mod != 0:
    ball = ('b'* a + 'r'* b) * (count + 1)
else:
    ball = ('b'* a + 'r'* b) * count

ans_ball = ball[:n]


print(ans_ball.count('b'))

Fixed submission:
#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)

ans = a * count + min(mod, a)
print(ans)

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)
#print(count, mod)

if mod != 0:
    ball = ('b'* a + 'r'* b) * (count + 1)
else:
    ball = ('b'* a + 'r'* b) * count

ans_ball = ball[:n]

print(ans_ball.count('b'))

Fixed submission:
#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)

ans = a * count + min(mod, a)
print(ans)

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
n, a, b = map(int, input().split())

if n >= (a+b):
    count = n // (a+b)
    mod = n % (a+b)
    #print(count, mod)
else:
    count = 1
    mod = 0

if mod != 0:
    ball = ('b'* a + 'r'* b) * (count + 1)
else:
    ball = ('b'* a + 'r'* b) * count

ans_ball = ball[:n]

print(ans_ball.count('b'))

Fixed submission:
#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)

ans = a * count + min(mod, a)
print(ans)

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
n, a, b = map(int, input().split())
count = n // (a+b)
mod = n % (a+b)
#print(count, mod)
ball = ('b'* a + 'r'* b) * count

if mod >= 1:
    ball = ball + 'b'* a + 'r'* b

ans_ball = ball[:n]
print(ans_ball.count('b'))

Fixed submission:
#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)

ans = a * count + min(mod, a)
print(ans)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
import sys
sys.setrecursionlimit(1000000000000)
a, b, k = map(int, input().split())

for i in range(0, k):
    if a >= 1:
        a = a - 1
    elif b >= 1:
        b = b - 1
    else:
        pass

print(a, b)

Fixed submission:
#coding:utf-8

a, b, k = map(int, input().split())

if k <= a:
    a = a - k
elif a < k and k <= (a + b):
    b = b - (k - a)
    a = 0
elif (a + b) < k:
    a = 0
    b = 0

print(a, b)
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
import collections

def prime():
    prime = [2, 3]
    for i in range(5, 1000000, 2):
        flag = True
        for j in range(1, len(prime)):
            if prime[j] ** 2 > i:
                break
            if i % prime[j] == 0:
                flag = False
                break
        if flag:
            prime.append(i)
    return prime

if __name__ == "__main__":
    x = int(input())
    prime = prime()
    #print(prime)
    for num in prime:
        if int(num) >= x:
            print(num)
            break

Fixed submission:
#coding:utf-8
import math

#素数判定
def prime(n):
    if n == 2:
        return True
    elif (n < 2) or (n % 2 == 0):
        return  False
    else:
        i = 3
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            i += 2

        return True

if __name__ == "__main__":
    x = int(input())
    num = x

    while prime(num) == False:
        num += 1

    print(num)

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
import collections

def prime():
    prime = [2, 3]
    for i in range(5, 1000000, 2):
        flag = True
        for j in range(1, len(prime)):
            if prime[j] ** 2 > i:
                break
            if i % prime[j] == 0:
                flag = False
                break
        if flag:
            prime.append(i)
    return prime

if __name__ == "__main__":
    x = int(input())
    prime = prime()
    #print(prime)
    for num in prime:
        if int(num) >= x:
            print(num)
            break

Fixed submission:
#coding:utf-8
import math

#素数判定
def prime(n):
    if n == 2:
        return True
    elif (n < 2) or (n % 2 == 0):
        return  False
    else:
        i = 3
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            i += 2

        return True

if __name__ == "__main__":
    x = int(input())
    num = x

    while prime(num) == False:
        num += 1

    print(num)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
n = int(input())
#切り上げ
x = int(-(-n // 1.08))

if x * 1.08 == n:
  print(x)
else:
  print(':(')



Fixed submission:
#coding:utf-8
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if d2 == 1:
  print('1')
else:
  print('0')
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
a, b = map(int, input())

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

Fixed submission:
#coding:utf-8
a, b = map(int, input().split())

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
a, b = map(int, input().split)
print(min(0, a - 2*b))

Fixed submission:
#coding:utf-8
a, b = map(int, input().split())
print(max(0, a - 2*b))

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
a, b = map(int, input().split)
print(max(0, a - 2*b))

Fixed submission:
#coding:utf-8
a, b = map(int, input().split())
print(max(0, a - 2*b))
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
n = int(input())
a = list(map(int, input().split()))
ans = []


for i in range(1, n+1):
    for j in range(0, n):
        if i == a[j]:
            ans.append(j+1)

print(*ans)

Fixed submission:
#coding:utf-8
import bisect
n = int(input())
a = list(map(int, input().split()))
num = list(range(1, n+1))
dic = {key: val for key, val in zip(num, a)}
#print(dic)

result = sorted(dic.items(), key=lambda x:x[1])

ans = [i[0] for i in result] 
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
n = int(input())
a = list(map(int, input().split()))
a_sort = sorted(a)
ans = []

for i in range(0, n):
    for j in range(0, n):
        if a_sort[i] == a[j]:
            ans.append(j+1)

print(*ans)

Fixed submission:
#coding:utf-8
import bisect
n = int(input())
a = list(map(int, input().split()))
num = list(range(1, n+1))
dic = {key: val for key, val in zip(num, a)}
#print(dic)

result = sorted(dic.items(), key=lambda x:x[1])

ans = [i[0] for i in result] 
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
n = int(input())
a = list(map(int, input().split()))
a_sort = sorted(a)
ans = []

for i in range(0, n):
    for j in range(0, n):
        if a_sort[i] == a[j]:
            ans.append(j+1)

print(*ans)

Fixed submission:
#coding:utf-8
import bisect
n = int(input())
a = list(map(int, input().split()))
num = list(range(1, n+1))
dic = {key: val for key, val in zip(num, a)}
#print(dic)

result = sorted(dic.items(), key=lambda x:x[1])

ans = [i[0] for i in result] 
print(*ans)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
import fractions
#import math

#素因数分解
def prime_factorial(num):
    fact = []
    for i in range(2, int(num**0.5)+1):
        while num % i == 0:
            fact.append(i)
            num = num // i
    if num != 1:
        fact.append(num)
        return fact

if __name__ == "__main__":
    #最大公約数を素因数分解し、その個数＋1が答え
    a, b = map(int, input().split())
    #g = math.gcd(a, b)
    g = fractions.gcd(a, b)
    #print(g)

    fact = prime_factorial(g)
    print(len(set(fact)) + 1)

Fixed submission:
#coding:utf-8
import fractions
#import math
import collections
#素因数分解
def prime_factorial(num):
    fact = []
    for i in range(2, int(num**0.5)+1):
        while num % i == 0:
            fact.append(i)
            num = num // i
    if num != 1:
        fact.append(num)
    return fact

if __name__ == "__main__":
    #最大公約数を素因数分解し、その個数＋1が答え
    a, b = map(int, input().split())
    #g = math.gcd(a, b)
    g = fractions.gcd(a, b)
    #print(g)
    #print(prime_factorial(g))

    c = collections.Counter(prime_factorial(g))
    print(len(list(c.keys())) + 1)

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
import fractions
#import math

#素因数分解
def prime_factorial(num):
    fact = []
    for i in range(2, int(num**0.5)+1):
        if num % i == 0:
            fact.append(i)
            num = num // i
    if num != 1:
        fact.append(num)
        return fact

if __name__ == "__main__":
    #最大公約数を素因数分解し、その個数＋1が答え
    a, b = map(int, input().split())
    #g = math.gcd(a, b)
    g = fractions.gcd(a, b)
    #print(g)
    #最大公約数が1の場合は1しかないのでそのまま出力。それ以外は素因数分解させる
    if g == 1:
        print(1)
    else:
        fact = prime_factorial(g)
        print(len(set(fact)) + 1)

Fixed submission:
#coding:utf-8
import fractions
#import math
import collections
#素因数分解
def prime_factorial(num):
    fact = []
    for i in range(2, int(num**0.5)+1):
        while num % i == 0:
            fact.append(i)
            num = num // i
    if num != 1:
        fact.append(num)
    return fact

if __name__ == "__main__":
    #最大公約数を素因数分解し、その個数＋1が答え
    a, b = map(int, input().split())
    #g = math.gcd(a, b)
    g = fractions.gcd(a, b)
    #print(g)
    #print(prime_factorial(g))

    c = collections.Counter(prime_factorial(g))
    print(len(list(c.keys())) + 1)
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8

n, k, q = map(int, input().split())
a = [input() for i in range(q)]
point = [k] * n
#print(point)

for i in range(0, q):
    point = [j-1 for j in point]
    point[int(a[i])-1] += 1
    #print(point)

for i in point:
    if i <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
#coding:utf-8

n, k, q = map(int, input().split())
a = [input() for i in range(q)]
point = [k-q] * n
#print(point)

for i in range(0, q):
    point[int(a[i])-1] += 1
    #print(point)

for i in point:
    if i <= 0:
        print('No')
    else:
        print('Yes')
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
a, b = map(int, input().split())

if a >= b:
    print(1)
else:
    #1つタップを増やすとa-1口増えるので、b-1口増やすことを考える
    tap = -(-（((b-1)//(a-1)))
    print(tap)

Fixed submission:
#coding:utf-8
a, b = map(int, input().split())

#1つタップを増やすとa-1口増えるので、b-1口増やすことを考える
tap = -(-(b-1)//(a-1))
print(tap)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
n = int(input())
h = list(map(int, input().split()))

ans = []
count = 0

for i in range(0, n-1):
    if h[i] >= h[i+1]:
        count += 1
    else:
        ans.append(count)
        count = 0

print(max(ans))

Fixed submission:
# coding:utf-8
n = int(input())
h = list(map(int, input().split()))

ans = 0
tmp = 0

for i in range(0, n - 1):
    if h[i] >= h[i + 1]:
        tmp += 1
    else:
        ans = max(tmp, ans)
        tmp = 0

ans = max(tmp, ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0

for i in range(n):
    if a[i] >= b[i]:
        ans += b[i]
    else:
        ans += a[i]
        b[i] -= a[i]
        if a[i + 1] >= b[i]:
            a[i + 1] -= b[i]
            ans += b[i]
        else:
            ans += a[i + i]
            a[i + 1] = 0


print(ans)


Fixed submission:
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0

for i in range(n):
    if a[i] >= b[i]:
        ans += b[i]
    else:
        ans += a[i]
        b[i] -= a[i]
        if a[i + 1] >= b[i]:
            a[i + 1] -= b[i]
            ans += b[i]
        else:
            ans += a[i + 1]
            a[i + 1] = 0


print(ans)

Buggy python submission (verdict: Runtime Error):
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0

for i in range(n):
    if a[i] >= b[i]:
        ans += b[i]
    else:
        ans += a[i]
        b[i] -= a[i]
        if a[i + 1] >= b[i]:
            ans += b[i]
            a[i + 1] -= b[i]
        else:
            ans += a[i + i]
            a[i + 1] = 0


print(ans)


Fixed submission:
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0

for i in range(n):
    if a[i] >= b[i]:
        ans += b[i]
    else:
        ans += a[i]
        b[i] -= a[i]
        if a[i + 1] >= b[i]:
            a[i + 1] -= b[i]
            ans += b[i]
        else:
            ans += a[i + 1]
            a[i + 1] = 0


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
l, r = map(int, input().split())
ans = (l*r) % 2019

for i in range(l, r-1):
    for j in range(0, r-l):
        if (i + j <= r) and (i != (i+j)):
            mod = (i * (i+j))% 2019
            if mod < ans:
                ans = mod

print(ans)

Fixed submission:
#coding:utf-8
#余りが0になった時点で以降の処理をやめる
import math
l, r = map(int, input().split())
ans = 2018

for i in range(l, r+1):
    for j in range(i+1, r+1):
        mod = (i * j) % 2019
        if mod < ans:
            ans = mod
        if mod == 0:
            ans = 0
            break
    else:
    #最小値が入れ替わらない、もしくは0が出なかった場合は次の数と比較
        continue
    break

print(ans)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)

Fixed submission:
#coding:utf-8
from scipy.misc import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())


for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % (10 ** 9 + 7))


Fixed submission:
#coding:utf-8
from scipy.misc import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())


for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    ans = blue * blue_num % (10 ** 9 + 7)
    print(ans)


Fixed submission:
#coding:utf-8
from scipy.misc import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())


for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    ans = blue * blue_num % (pow(10,9)+ 7)
    print(ans)

Fixed submission:
#coding:utf-8
from scipy.misc import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)

Buggy python submission (verdict: Runtime Error):
coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())
all_ans = comb(n, k, exact=True)
cmb = 0
#print(a)

for i, j in zip(range(n-k+1, n), range(1, k)):
    #print(i, j)
    a = comb(i, j, exact=True)
    ans = a % (pow(10,9)+ 7)
    cmb += ans
    print(ans)

print((all_ans - cmb) % (pow(10,9)+ 7))


Fixed submission:
#coding:utf-8
from scipy.misc import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)