Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()

num_char=0
for i in range(len(T)):
    for j in range(i+1,len(T)):
        if T[i:j] in S[i:]:
            print(T[i:j])
            if num_char<j-i:
                num_char=j-i
print(len(T)-num_char)

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

best_num_char=0
for i in range(len(S)-len(T)+1):
    # print(T[i:])
    num_char=0
    for j in range(len(T)):
        num_char+=1 if S[i+j]==T[j] else 0
        # print(num_char,S[i + j])
    if best_num_char<num_char:
        best_num_char=num_char

# print(len(T))
print(len(T)-best_num_char)
Buggy python submission (verdict: Runtime Error):
k=int(input())


init=7
for i in range(k+1):
  if init%k ==0:
    print(i+1)
    break
  t = t*10+7
print(-1)

Fixed submission:
x=int(input())

print('Yes') if x>29 else print('No')
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
 
ans=-1
init=7
for i in range(k+1):
  if init%k ==0:
    ans=i+1
    break
  init = init*10+7
print(ans)

Fixed submission:
k=int(input())
 
ans=-1
init=7
for i in range(k+1):
  if init%k ==0:
    ans=i+1
    break
  init = (init*10+7)%k
print(ans)

Buggy python submission (verdict: Runtime Error):
k=int(input())
 
 
init=7
for i in range(k+1):
  if init%k ==0:
    print(i+1)
    break
  t = t*10+7
print(-1)

Fixed submission:
k=int(input())
 
ans=-1
init=7
for i in range(k+1):
  if init%k ==0:
    ans=i+1
    break
  init = (init*10+7)%k
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()

s = [input() for _ in range(n)]

print('AC x ', s.count('AC'))
print('WA x ', s.count('WA'))
print('TLE x ', s.count('TLE'))
print('RE x ', s.count('RE'))


Fixed submission:
n = int(input())

s = [input() for _ in range(n)]

print('AC x ', s.count('AC'))
print('WA x ', s.count('WA'))
print('TLE x ', s.count('TLE'))
print('RE x ', s.count('RE'))
Buggy python submission (verdict: Time Limit Exceeded):
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(N, As):
    import math
    primes = [0] * (max(As) + 1)
    pairwise_flg = True
    for x in As:
        i = 2
        while x != 1:
            if x % i == 0:
                if primes[i] != 0:
                    pairwise_flg = False
                    break
                primes[i] = 1
                while x % i == 0:
                    x = x // i
            else:
                i += 1
                if i > math.sqrt(x):
                    if primes[x] != 0:
                        pairwise_flg = False
                    else:
                        primes[x] = 1
                    break
        if not pairwise_flg:
            break
    if pairwise_flg:
        print('pairwise coprime')
        return

    tmp = math.gcd(As[0], As[1])
    for A in As:
        tmp = math.gcd(tmp, A)
    if tmp == 1:
        print('setwise coprime')
        return

    print('not coprime')


if __name__ == '__main__':
    N = int(input())
    As = [int(i) for i in input().split()]
    # # test
    # import random
    # N = 10 ** 6
    # As = [random.randint(1, 10 ** 6) for _ in range(N)]
    solve(N, As)



Fixed submission:
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, As):
    import math
    primes = [0] * (max(As) + 1)
    pairwise_flg = True
    for x in As:
        i = 2
        while x != 1:
            if x % i == 0:
                if primes[i] != 0:
                    pairwise_flg = False
                    break
                primes[i] = 1
                while x % i == 0:
                    x = x // i
            else:
                i += 1
                if i > math.sqrt(x):
                    if primes[x] != 0:
                        pairwise_flg = False
                    else:
                        primes[x] = 1
                    break
        if not pairwise_flg:
            break
    if pairwise_flg:
        print('pairwise coprime')
        return

    tmp = math.gcd(As[0], As[1])
    for A in As:
        tmp = math.gcd(tmp, A)
    if tmp == 1:
        print('setwise coprime')
        return

    print('not coprime')


if __name__ == '__main__':
    N = int(input())
    As = [int(i) for i in input().split()]
    # # test
    # import random
    # N = 10 ** 6
    # As = [random.randint(1, 10 ** 6) for _ in range(N)]
    solve(N, As)
Buggy python submission (verdict: Time Limit Exceeded):
# 解説を参考に作成

# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(H, W, C, D, Ss):
    cost_map = [[-1] * (W + 4) for _ in range(H + 4)]
    Ss = ['#' * (W + 4)] * 2 + ['##' + S + '##' for S in Ss] + ['#' * (W + 4)] * 2
    C = [c + 1 for c in C]
    D = [d + 1 for d in D]
    cost = 0
    ans = -1
    dq = deque()
    dq.append(C)
    while dq:
        next_dq = deque()
        flg = False
        while dq:
            h, w = dq.popleft()
            if h == D[0] and w == D[1]:
                ans = cost
                flg = True
                break
            if cost_map[h][w] >= 0:
                continue
            cost_map[h][w] = cost
            for i in range(h - 2, h + 2 + 1):
                for j in range(w - 2, w + 2 + 1):
                    if Ss[i][j] == '#':
                        continue
                    if cost_map[i][j] >= 0:
                        continue
                    if abs(h - i) + abs(w - j) == 1:
                        dq.append([i, j])
                    else:
                        next_dq.append([i, j])
        if flg:
            break
        dq = next_dq
        cost += 1
    print(ans)


if __name__ == '__main__':
    # S = input()
    # N = int(input())
    H, W = map(int, input().split())
    C = [int(i) for i in input().split()]
    D = [int(i) for i in input().split()]
    Ss = [input() for _ in range(H)]
    # Bs = [int(i) for i in input().split()]
    solve(H, W, C, D, Ss)


Fixed submission:
# 解説を参考に作成

# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(H, W, C, D, Ss):
    cost_map = [[-1] * (W + 4) for _ in range(H + 4)]
    Ss = ['#' * (W + 4)] * 2 + ['##' + S + '##' for S in Ss] + ['#' * (W + 4)] * 2
    C = [c + 1 for c in C]
    D = [d + 1 for d in D]
    cost = 0
    ans = -1
    dq = deque()
    dq.append(C)
    while dq:
        next_dq = deque()
        flg = False
        while dq:
            h, w = dq.popleft()
            if h == D[0] and w == D[1]:
                ans = cost
                flg = True
                break
            if cost_map[h][w] >= 0:
                continue
            cost_map[h][w] = cost
            for i in range(h - 2, h + 2 + 1):
                for j in range(w - 2, w + 2 + 1):
                    if Ss[i][j] == '#':
                        continue
                    if cost_map[i][j] >= 0:
                        continue
                    if abs(h - i) + abs(w - j) == 1:
                        dq.append([i, j])
                    else:
                        next_dq.append([i, j])
        if flg:
            break
        dq = next_dq
        cost += 1
    print(ans)


if __name__ == '__main__':
    # S = input()
    # N = int(input())
    H, W = map(int, input().split())
    C = [int(i) for i in input().split()]
    D = [int(i) for i in input().split()]
    Ss = [input() for _ in range(H)]
    # Bs = [int(i) for i in input().split()]
    solve(H, W, C, D, Ss)
Buggy python submission (verdict: Runtime Error):
# 検証と認識が甘かった


def solve(A, B):
    _B = round(B * 100)
    print(A * _B // 100)


if __name__ == '__main__':
    A, B = [float(i) for i in input().split()]
    A = int(A)
    sorted(A, B)


Fixed submission:
# 検証と認識が甘かった


def solve(A, B):
    _B = round(B * 100)
    print(A * _B // 100)


if __name__ == '__main__':
    A, B = [float(i) for i in input().split()]
    A = int(A)
    solve(A, B)
Buggy python submission (verdict: Runtime Error):
# 解説と 13355391 を参考に実装予定


import math


def solve():
    N = int(input())
    ABs = [[int(i) for i in input().split()] for _ in range(N)]
    mod = 10 ** 9 + 7

    lonlieness = 0
    pairs = {}
    for AB in ABs:
        a, b = AB
        if a == 0 and b == 0:
            lonlieness += 1
            continue
        elif a == 0:
            a, b = 1, 0
            bad_a, bad_b = 0, 1
        elif b == 0:
            a, b = (0, 1)
            bad_a, bad_b = 1, 0
        else:
            _gcd = math.gcd(a, b)
            a //= _gcd
            b //= _gcd
            bad_a = -b
            bad_b = a
            if b < 0:
                a, b = -a, -b
            if bad_b < 0:
                bad_a, bad_b = -bad_a, -bad_b
        pairs.setdefault((a, b), 0)
        pairs.setdefault((bad_a, bad_b), 0)  # 仲の悪いグループも登録しておく
        pairs[(a, b)] += 1

    permutations = []
    for i, pair in enumerate(pairs.keys()):
        if i % 2 == 1:
            continue
        a, b = pair
        bad_a, bad_b = -b, a
        if bad_b < 0:
            bad_a, bad_b = -bad_a, -bad_b
        group_num = pow(2, pairs[(a, b)], mod) - 1
        badgroup_num = pow(2, pairs[(bad_a, bad_b)], mod) - 1
        permutations.append(group_num + badgroup_num + 1)

    result = 1
    for p in permutations:
        result = result * p % mod

    result = (result + lonlieness - 1) % mod
    print(result)


if __name__ == '__main__':
    solve()


Fixed submission:
# 解説と 13355391 を参考に実装予定


import math


def solve():
    N = int(input())
    ABs = [[int(i) for i in input().split()] for _ in range(N)]
    mod = 10 ** 9 + 7

    lonlieness = 0
    pairs = {}
    for AB in ABs:
        a, b = AB
        if a == 0 and b == 0:
            lonlieness += 1
            continue
        elif a == 0:
            a, b = -1, 0
            bad_a, bad_b = 0, 1
        elif b == 0:
            a, b = (0, 1)
            bad_a, bad_b = -1, 0
        else:
            _gcd = math.gcd(a, b)
            a //= _gcd
            b //= _gcd
            bad_a = -b
            bad_b = a
            if b < 0:
                a, b = -a, -b
            if bad_b < 0:
                bad_a, bad_b = -bad_a, -bad_b
        pairs.setdefault((a, b), 0)
        pairs.setdefault((bad_a, bad_b), 0)  # 仲の悪いグループも登録しておく
        pairs[(a, b)] += 1

    permutations = []
    for i, pair in enumerate(pairs.keys()):
        if i % 2 == 1:
            continue
        a, b = pair
        bad_a, bad_b = -b, a
        if bad_b < 0:
            bad_a, bad_b = -bad_a, -bad_b
        group_num = pow(2, pairs[(a, b)], mod) - 1
        badgroup_num = pow(2, pairs[(bad_a, bad_b)], mod) - 1
        permutations.append(group_num + badgroup_num + 1)

    result = 1
    for p in permutations:
        result = result * p % mod

    result = (result + lonlieness - 1) % mod
    print(result)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
# 解説を参考に作成
def solve():
    S = input()
    lenS = len(S)
    mod_list = [0] * 2019
    Si = 0
    for i in range(lenS):
        Si += 10 ** i * int(S[lenS - 1 - i])
        x = Si % 2019
        mod_list[x] += 1
    result = 0
    for i, ml in enumerate(mod_list):
        if i == 0:
            result += ml
        result += int(ml * (ml - 1) / 2)
    print(result)


if __name__ == '__main__':
    solve()


Fixed submission:
# 解説を参考に作成
# さらに 提出 #12403542 を参考


def solve():
    S = input()
    lenS = len(S)
    mod_list = [0] * 2019
    x = 0
    for i in range(lenS):
        x = (int(S[lenS - 1 - i]) * pow(10, i, 2019) + x) % 2019
        mod_list[x] += 1

    result = 0
    for i, ml in enumerate(mod_list):
        if i == 0:
            result += ml
        result += int(ml * (ml - 1) / 2)
    print(result)


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
# 解説を参考に作成
def solve():
    S = input()
    lenS = len(S)
    # modS = []
    mod_list = [0] * 2019
    for i in range(lenS):
        x = int(S[lenS - 1 - i:]) % 2019
        # modS.append(int(S[lenS - 1 - i:]) % 2019)
        mod_list[x] += 1
    result = 0
    for i, ml in enumerate(mod_list):
        if i == 0:
            result += ml
        result += int(ml * (ml - 1) / 2)
    print(result)


if __name__ == '__main__':
    solve()


Fixed submission:
# 解説を参考に作成
# さらに 提出 #12403542 を参考


def solve():
    S = input()
    lenS = len(S)
    mod_list = [0] * 2019
    x = 0
    for i in range(lenS):
        x = (int(S[lenS - 1 - i]) * pow(10, i, 2019) + x) % 2019
        mod_list[x] += 1

    result = 0
    for i, ml in enumerate(mod_list):
        if i == 0:
            result += ml
        result += int(ml * (ml - 1) / 2)
    print(result)


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
# 解説を参考に作成
def solve():
    S = input()
    lenS = len(S)
    modS = []
    mod_list = [0] * 2019
    for i in range(lenS):
        x = int(S[lenS - 1 - i:]) % 2019
        modS.append(int(S[lenS - 1 - i:]) % 2019)
        mod_list[x] += 1
    result = 0
    for i, ml in enumerate(mod_list):
        if i == 0:
            result += ml
        result += int(ml * (ml - 1) / 2)
    print(result)


if __name__ == '__main__':
    solve()


Fixed submission:
# 解説を参考に作成
# さらに 提出 #12403542 を参考


def solve():
    S = input()
    lenS = len(S)
    mod_list = [0] * 2019
    x = 0
    for i in range(lenS):
        x = (int(S[lenS - 1 - i]) * pow(10, i, 2019) + x) % 2019
        mod_list[x] += 1

    result = 0
    for i, ml in enumerate(mod_list):
        if i == 0:
            result += ml
        result += int(ml * (ml - 1) / 2)
    print(result)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
from heapq import heappush, heappop


def solve(N, X, Y):
    ans = [0] * (N)

    G = [[] for _ in range(N + 1)]
    for i in range(1, N):
        G[i].append(i + 1)
        G[i + 1].append(i)
    G[X].append(Y)
    G[Y].append(X)

    def dfs(vertex):
        nears = [float('inf')] * (N + 1)
        depth = 0
        que = [[depth, vertex]]
        while que:
            d, v = heappop(que)
            if d < nears[v]:
                nears[v] = d
                for g in G[v]:
                    heappush(que, [d + 1, g])
        return nears

    for i in range(1, N):
        # dfs
        nears = dfs(i)
        # print(nears)
        for j in range(i + 1, N + 1):
            ans[nears[j]] += 1

    for i in ans[1:]:
        print(i)


if __name__ == '__main__':
    N, X, Y = map(int, input().split())
    solve(N, X, Y)


Fixed submission:
# 解説を参考に作成


def solve(N, X, Y):
    ans = [0] * (N)

    for i in range(1, N):
        for j in range(i + 1, N + 1):
            k = min(abs(j - i), abs(X - i) + 1 + abs(Y - j))
            ans[k] += 1

    for i in ans[1:]:
        print(i)


if __name__ == '__main__':
    N, X, Y = map(int, input().split())
    solve(N, X, Y)
Buggy python submission (verdict: Time Limit Exceeded):
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(S, Q, Qs):
    rev_flg = False
    ans = S
    for q in Qs:
        if q[0] == 1:
            rev_flg = not rev_flg
        else:
            bf = q[1]
            if (bf == 1 and not rev_flg) or (bf == 2 and rev_flg):
                ans = q[2] + ans
            else:
                ans = ans + q[2]
    if rev_flg:
        ans = ans[::-1]
    print(ans)


if __name__ == '__main__':
    S = input()
    Q = int(input())
    Qs = []
    for _ in range(Q):
        s = input()
        if s[0] == '1':
            q = [1]
        else:
            q = s.split()
            q[0] = int(q[0])
            q[1] = int(q[1])

        Qs.append(q)
    solve(S, Q, Qs)


Fixed submission:
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(S, Q, Qs):
    rev_flg = False
    bef = ''
    aft = ''
    for q in Qs:
        if q[0] == 1:
            rev_flg = not rev_flg
            bef, aft = aft, bef
        else:
            bf = q[1]
            if bf == 1:
                bef += q[2]
            elif bf == 2:
                aft += q[2]
    bef = bef[::-1]
    if rev_flg:
        S = S[::-1]
    print(bef + S + aft)


    # for q in Qs:
    #     if q[0] == 1:
    #         rev_flg = not rev_flg
    #     else:
    #         bf = q[1]
    #         if (bf == 1 and not rev_flg) or (bf == 2 and rev_flg):
    #             ans = q[2] + ans
    #         else:
    #             ans = ans + q[2]
    # if rev_flg:
    #     ans = ans[::-1]
    # print(ans)


if __name__ == '__main__':
    # # handmade
    # S = 'h' * 10 ** 5
    # Q = 2 * 10 ** 5
    # Qs = []
    # for i in range(Q - 1):
    #     if i % 2 == 0:
    #         Qs.append([2, 1, 'a'])
    #     else:
    #         Qs.append([2, 2, 'b'])
    # Qs.append([1])

    # input
    S = input()
    Q = int(input())
    Qs = []
    i = 0
    for _ in range(Q):
        s = input()
        i += 1
        if s[0] == '1':
            q = [1]
        else:
            q = s.split()
            q[0] = int(q[0])
            q[1] = int(q[1])

        Qs.append(q)
    solve(S, Q, Qs)
Buggy python submission (verdict: Runtime Error):
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect


def lcm(a, b):
    """最小公倍数"""
    from math import gcd
    return (a * b) // gcd(a, b)


# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(A, B):
    print(lcm(A, B))


if __name__ == '__main__':
    A, B = map(int, input().split())
    solve(A, B)


Fixed submission:
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect


def gcd(a, b):
    """最大公約数"""
    a, b = (a, b) if a >= b else (b, a)
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    """最小公倍数"""
    # from math import gcd
    return (a * b) // gcd(a, b)


# from decorator import stop_watch
#
#
# @stop_watch
def solve(A, B):
    print(lcm(A, B))


if __name__ == '__main__':
    A, B = map(int, input().split())
    solve(A, B)
Buggy python submission (verdict: Runtime Error):
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(N, As):
    import math
    x = math.ceil(math.log2(max(As)))
    ans = 0
    for i in range(x):
        count0 = 0
        count1 = 0
        for A in As:
            if (A >> i) % 2 == 0:
                count0 += 1
            else:
                count1 += 1
        # print(i, count0, count1)
        ans += count0 * count1 * (2 ** i)
        ans = ans % (10 ** 9 + 7)
    print(ans)


if __name__ == '__main__':
    N = int(input())
    As = [int(i) for i in input().split()]
    # N = 3 * 10 ** 5
    # import random
    # As = [random.randint(0, 2 ** 60) for _ in range(N)]
    solve(N, As)


Fixed submission:
# 解説を参考に作成
# 提出 #14841909 を参考に作成

# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(N, As):
    import math
    x = 1 if max(As) == 0 else math.ceil(math.log2(max(As)))
    ans = 0
    mod = 10 ** 9 + 7

    for i in range(x):
        cnt = sum((A >> i) % 2 for A in As)
        ans += (cnt * (N - cnt)) * pow(2, i, mod)
        ans = ans % mod
    print(ans)


if __name__ == '__main__':
    N = int(input())
    As = [int(i) for i in input().split()]
    # N = 3 * 10 ** 5
    # import random
    # As = [random.randint(2 ** 59, 2 ** 60) for _ in range(N)]
    solve(N, As)
Buggy python submission (verdict: Time Limit Exceeded):
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(N, M, ABs):
    ans = 0
    schedule = [0] * M
    max_start_day = [M - i for i in range(M + 1)]
    ABs.sort(key=lambda x: x[1], reverse=True)
    for A, B in ABs:
        if A > M:
            continue
        work_day = max_start_day[A]
        if work_day < 0:
            continue
        flg = False
        while schedule[work_day] != 0:
            work_day -= 1
            if work_day < 0:
                flg = True
                break
        if flg:
            max_start_day[A] = work_day
            continue
        ans += B
        schedule[work_day] = B
        max_start_day[A] = work_day - 1
    print(ans)


if __name__ == '__main__':
    N, M = map(int, input().split())
    ABs = [[int(i) for i in input().split()] for _ in range(N)]

    # from random import randint
    # N, M = 10 ** 5, 10 ** 5
    # ABs = [[randint(1, 10 ** 5), randint(1, 10 ** 4)] for _ in range(10 ** 5)]

    solve(N, M, ABs)

Fixed submission:
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, M, ABs):
    ans = 0
    schedule = [0] * M
    max_start_day = [M - i for i in range(M + 1)]
    ABs.sort(key=lambda x: x[1], reverse=True)
    for A, B in ABs:
        if A > M:
            continue
        work_day = max_start_day[A]
        if work_day < 0:
            continue
        flg = False
        while schedule[work_day] != 0:
            work_day -= 1
            if work_day < 0:
                flg = True
                break
        if flg:
            max_start_day[A] = work_day
            continue
        ans += B
        schedule[work_day] = B
        max_start_day[A] = work_day - 1
    print(ans)


if __name__ == '__main__':
    N, M = map(int, input().split())
    ABs = [[int(i) for i in input().split()] for _ in range(N)]

    # from random import randint
    # N, M = 10 ** 5, 10 ** 5
    # ABs = [[randint(1, 10 ** 5), randint(1, 10 ** 4)] for _ in range(10 ** 5)]

    solve(N, M, ABs)
Buggy python submission (verdict: Time Limit Exceeded):


def solve():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    color_list = [-1]
    min_A = min(color_list)
    for a in A:
        if min_A < a:
            for i in range(len(color_list)):
                tag = color_list[i]
                if tag < a:
                    color_list[i] = a
                    if tag == min_A:
                        min_A = min(color_list)
                    break
        else:
            color_list.append(a)
            min_A = a
    # print(color_list)
    print(len(color_list))


if __name__ == '__main__':
    solve()


Fixed submission:
"""
提出 #6475942 を参考に作成
"""

import bisect


def solve():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    color_list = [A[-1]]
    for a in reversed(A[:-1]):
        # a より大きい数の中で一番小さい数の場所を取得する
        c = bisect.bisect_left(color_list, a + 1)
        if c == len(color_list):
            color_list.append(a)
        else:
            color_list[c] = a
    print(len(color_list))


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
def solve_commentary():
    N, K = map(int, input().split())
    R = N - K  # 赤玉の数
    MOD = 10 ** 9 + 7
    for i in range(1, K + 1):
        print((combinations_count(N - K + 1, i) * combinations_count(K - 1, i - 1)) % (MOD))
        pass
    pass


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


def ppprint(itr_obj):
    for ite in itr_obj:
        print(ite)


if __name__ == '__main__':
    # solve()
    solve_commentary()


Fixed submission:

def solve_commentary():
    N, K = map(int, input().split())
    R = N - K  # 赤玉の数
    MOD = 10 ** 9 + 7
    for i in range(1, K + 1):
        if N - K + 1 >= i:
            print((combinations_count(N - K + 1, i) * combinations_count(K - 1, i - 1)) % (MOD))
        else:
            print(0)
        pass
    pass


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


def ppprint(itr_obj):
    for ite in itr_obj:
        print(ite)


if __name__ == '__main__':
    # solve()
    solve_commentary()