Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    n, m = map(int, input().split())
    ab = [list(map(int, input().split())) for i in range(n)]
    ab = sorted(ab, key=lambda x: x[1], reverse=True)

    free_day = set(list(range(m + 1)))
    answer = 0
    for i in range(n):
        a = ab[i][0]
        b = ab[i][1]
        work_days = {day for day in free_day if m-day >= a}
        if len(work_days) != 0:
            free_day.remove(max(work_days))
            answer += b
    print(answer)


Fixed submission:
from heapq import heappush, heappop


#  https://atcoder.jp/contests/abc137/submissions/6840855 を参考にした。
q = []
if __name__ == '__main__':
    n, m = map(int, input().split())
    ab = [list(map(int, input().split())) for i in range(n)]
    ab = sorted(ab, reverse=True)

    q = []
    answer = 0
    for i in range(m-1, -1, -1):
        while ab and i + ab[-1][0] <= m:
            (a, b) = ab.pop()
            heappush(q, -b)

        if q:
            answer -= heappop(q)

    print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    n, m = map(int, input().split())
    ab = [list(map(int, input().split())) for i in range(n)]
    ab = sorted(ab, key=lambda x: x[1], reverse=True)

    free_day = set(list(range(m + 1)))
    answer = 0
    for i in range(n):
        max_free_day = max(free_day)
        a = ab[i][0]
        b = ab[i][1]
        work_days = [day for day in free_day if m-day >= a]
        if len(work_days) != 0:
            free_day.remove(max(work_days))
            answer += b
    print(answer)

Fixed submission:
from heapq import heappush, heappop


#  https://atcoder.jp/contests/abc137/submissions/6840855 を参考にした。
q = []
if __name__ == '__main__':
    n, m = map(int, input().split())
    ab = [list(map(int, input().split())) for i in range(n)]
    ab = sorted(ab, reverse=True)

    q = []
    answer = 0
    for i in range(m-1, -1, -1):
        while ab and i + ab[-1][0] <= m:
            (a, b) = ab.pop()
            heappush(q, -b)

        if q:
            answer -= heappop(q)

    print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


if __name__ == '__main__':
    S = int(input())
    prime_numbers = factorization(S)

    prime_numbers_list = []

    for e in prime_numbers:
        number, count = e
        for i in range(count):
            prime_numbers_list.append(number)


    # bit全探索
    pattern = len(prime_numbers_list)
    for i in range(2**pattern):
        width = 1
        height = 1
        index = 0
        for j in range(pattern):
            if ((i >> j) & 1) == 1:
                width *= prime_numbers_list[index]
            else:
                height *= prime_numbers_list[index]
            index += 1
        if (width <= 10**9) and (height <= 10**9):
            break

    x1 = 0
    y1 = 0
    x2 = width
    y2 = 0
    x3 = 0
    y3 = height

    print(str(x1) + ' ' + str(y1) + ' ' + str(x2) + ' ' + str(y2) + ' ' + str(x3) + ' ' + str(y3))

Fixed submission:
if __name__ == '__main__':
    S = int(input())

    x0 = 0
    x1 = 10**9
    x2 = 1
    y0 = 0
    y2 = (S + x1 - 1)//x1
    y1 = x1 * y2 - S

    print(str(x0) + ' ' + str(y0) + ' ' + str(x1) + ' ' + str(y1) + ' ' + str(x2) + ' ' + str(y2))
Buggy python submission (verdict: Runtime Error):
import collections


S = list(input())

c = collections.Counter(S)

if max(c.values) >= 2:
  print("Bad")
else:
  print("Good")


Fixed submission:
import collections


S = list(input())

answer = 'Good'
for i in range(1, len(S)):
  if S[i] == S[i-1]:
    answer = 'Bad'

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    N, M = map(int, input().split())

    LR = [list(map(int, input().split())) for i in range(M)]

    LR1 = LR[0]
    L1 = LR1[0]
    R1 = LR1[1]

    my_list = range(L1, R1+1)

    for tmp_LR in LR[1::]:
        tmp_L = tmp_LR[0]
        tmp_R = tmp_LR[1]

        my_list = [e for e in my_list if e >= tmp_L and e <= tmp_R]

    answer = len(my_list)
    print(answer)


Fixed submission:
if __name__ == '__main__':
    N, M = map(int, input().split())

    LR = [list(map(int, input().split())) for i in range(M)]

    LR1 = LR[0]
    maxL = LR1[0]
    minR = LR1[1]

    for tmp_LR in LR[1::]:
        tmp_L = tmp_LR[0]
        tmp_R = tmp_LR[1]

        if tmp_L >= maxL:
            maxL = tmp_L

        if tmp_R <= minR:
            minR = tmp_R

    my_list = range(maxL, minR + 1)

    answer = len(my_list)
    print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math

if __name__ == '__main__':
    N, K = map(int, input().split())

    answer = 0
    for c in list(itertools.combinations(range(1, N+1), K)):
        c_list = sorted(list(c))
        min_c_element = min(c_list)
        continue_num = list(range(min_c_element, min_c_element + K))
        if c_list == continue_num:
            answer += 1
    print(answer)


Fixed submission:
if __name__ == '__main__':
    N, K = map(int, input().split())

    answer = N - K + 1
    print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    input_list = list(map(int, input().split()))
    N = input_list[0]
    M = input_list[1]

    A = [0]*N
    B = [0]*N

    for i in range(N):
        A[i], B[i] = map(int, input().split())

    for i in range(N):
        if i == 0:
            prices = [A[0]]*B[0]
        else:
            prices.extend([A[i]]*B[i])

    sorted_prices = sorted(prices)

    answer = 0

    for i in range(M):
        answer += sorted_prices[i]

    print(answer)

Fixed submission:
if __name__ == '__main__':
    input_list = list(map(int, input().split()))
    N = input_list[0]
    M = input_list[1]

    AB = [list(map(int, input().split())) for i in range(N)]

    sorted_AB = sorted(AB, key=lambda x:x[0])

    answer = 0
    cnt = 0
    for e in sorted_AB:
        pre_cnt = cnt

        Ai = e[0]
        Bi = e[1]

        cnt = min(M, cnt+Bi)
        answer += Ai * (cnt - pre_cnt)

        if cnt == M:
            break

    print(answer)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    A, B, K = map(int, input().split())

    cnt = 0
    for i in range(1, min(A, B)):
        if A % i == 0 and B % i == 0:
            cnt += 1
        if cnt == K:
            answer = i
            break

    print(answer)

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

    answer = 1
    cnt = 0
    for i in range(min(A, B), 1, -1):
        if A % i == 0 and B % i == 0:
            cnt += 1
        if cnt == K:
            answer = i
            break

    print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    S = str(input())
    N = len(S)

    answer = 0
    for i in range(0, N):
        index_00 = S.find('01')
        if index_00 != -1:
            answer += 2
            S = S[:index_00] + S[index_00+2:]
            continue
        index_11 = S.find('10')
        if index_11 != -1:
            answer += 2
            S = S[:index_11] + S[index_11+2:]
            continue
        if S.find('01') == -1 and S.find('10') == -1:
            break

    print(answer)

Fixed submission:
if __name__ == '__main__':
    S = str(input())
    N = len(S)

    count_0 = S.count('0')
    count_1 = S.count('1')

    answer = 2 * min(count_0, count_1)

    print(answer)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=0
for i in range(4):
  if n%10=2:
    ans+=1
  n=n/10
print(ans)

Fixed submission:
n=int(input())
ans=0
for i in range(4):
  if int(n%10)==2:
    ans+=1
  n=n/10
print(ans)
Buggy python submission (verdict: Runtime Error):
d = int(input())

if d=25:
  print('Christmas')
elif d=24:
  print('Christmas Eve')
elif d=23:
  print('Christmas Eve Eve')
elif d=22:
  print('Christmas Eve Eve Eve')


Fixed submission:
d = int(input())

if d==25:
  print('Christmas')
elif d==24:
  print('Christmas Eve')
elif d==23:
  print('Christmas Eve Eve')
elif d==22:
  print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    X, Y = map(int, input().split())

    print(int(X + y/2))



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

    print(int(X+Y/2))
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    N = int(input())

    answer = -1
    for i in range(N, 999):
        i_str = str(i)
        if i_str[0] == i_str[1] and i_str[1] == i_str[2]:
            answer = i_str
            break
    print(i_str)

Fixed submission:
if __name__ == '__main__':
    N = int(input())

    answer = -1
    for i in range(N, 1000):
        i_str = str(i)
        if i_str[0] == i_str[1] and i_str[1] == i_str[2]:
            answer = i_str
            break
    print(i_str)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

if (a＊b)%2==1:
  print('Yes')
else:
  print('No')

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

if (a*b)%2==1:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
k = int(input())

if k == 0:
  print(0)
else:
  even = k//2
  if k%2==0:
    odd = k-1
  else
    odd = k
  print(str(even*odd))


Fixed submission:
k = int(input())

if k == 0:
  print(0)
else:
  if k%2==0:
    even = k
    odd = k-1
  else:
    even = k - 1
    odd = k
  print(str((even//2)*((odd+1)//2)))

Buggy python submission (verdict: Runtime Error):
k = int(input())

if k == 0:
  print(0)
else:
  even = k//2
  if k%2==0:
    odd = k-1
  else:
  odd = k
  print(str(even*odd))

Fixed submission:
k = int(input())

if k == 0:
  print(0)
else:
  if k%2==0:
    even = k
    odd = k-1
  else:
    even = k - 1
    odd = k
  print(str((even//2)*((odd+1)//2)))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import sys


if __name__ == '__main__':
    D, G = map(int, input().split())
    # pc_list = [list(map(int,input().split())) for i in range(D)]

    p = ['-1'] * D
    c = ['-1'] * D

    for i in range(D):
        p[i], c[i] = map(int, input().split())

    if D == 1:
        my_list = list(itertools.product(range(p[0]+1)))
    elif D == 2:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1)))
    elif D == 3:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1), range(p[2]+1)))
    elif D == 4:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1), range(p[2]+1), range(p[3]+1)))
    elif D == 5:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1), range(p[2]+1), range(p[3]+1), range(p[4]+1)))
    elif D == 6:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1), range(p[2]+1), range(p[3]+1), range(p[4]+1), range(p[5]+1)))
    elif D == 7:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1), range(p[2]+1), range(p[3]+1), range(p[4]+1), range(p[5]+1), range(p[6]+1)))
    elif D == 8:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1), range(p[2]+1), range(p[3]+1), range(p[4]+1), range(p[5]+1), range(p[6]+1), range(p[7]+1)))
    elif D == 9:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1), range(p[2]+1), range(p[3]+1), range(p[4]+1), range(p[5]+1), range(p[6]+1), range(p[7]+1), range(p[8]+1)))
    elif D == 10:
        my_list = list(itertools.product(range(p[0]+1),range(p[1]+1), range(p[2]+1), range(p[3]+1), range(p[4]+1), range(p[5]+1), range(p[6]+1), range(p[7]+1), range(p[8]+1), range(p[9]+1)))

    min_count = sys.maxsize
    for e in my_list:
        e_list = list(e)
        score = 0
        for i in range(len(e_list)):
            score += (i+1)*100*e_list[i]
            if e[i] == p[i]:
                score += c[i]
        count = sum(e_list)
        if score >= G and min_count > count:
            min_count = count
    print(min_count)


Fixed submission:
import sys


if __name__ == '__main__':
    D, G = map(int, input().split())
    p = ['-1'] * D
    c = ['-1'] * D
    for i in range(D):
        p[i], c[i] = map(int, input().split())

    answer = sys.maxsize
    for i in range(pow(2, D)):
        bonus_flags = format(i, "b").zfill(D)

        score = 0
        count = 0
        remain = []
        for index, bonus_flag in enumerate(bonus_flags):
            if bonus_flag == '1':
                score += (index + 1) * 100 * p[index] + c[index]
                count += p[index]
            else:
                remain.append(index)
        if score < G:
            R = G - score
            j = remain[-1]

            if (p[j] - 1) * (j+1) * 100 < R:
                continue
            count += -(-R//(100*(j+1)))
        answer = min(answer, count)

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

if a <= x <= a+b:
:(tnirp )"SEY"
  :esle
    )"ON@"(tnir

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

if a<=x<=a+b:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import copy


if __name__ == '__main__':
    N = int(input())
    X_list = list(map(int, input().split()))

    answer = -1
    for i in range(0, N):
        tmp_X_list = copy.deepcopy(X_list)
        del(tmp_X_list[i])
        tmp_X_list = sorted(tmp_X_list)
        answer = tmp_X_list[N//2-1]
        print(answer)


Fixed submission:
import copy


if __name__ == '__main__':
    N = int(input())
    X_list = list(map(int, input().split()))
    tmp_X_list = copy.deepcopy(X_list)
    tmp_X_list = sorted(tmp_X_list)
    med_minus1 = tmp_X_list[N//2-1]
    med_plus1 = tmp_X_list[N//2]

    answer = -1
    for i in range(0, N):
        if X_list[i] <= med_minus1:
            answer = med_plus1
        elif X_list[i] >= med_plus1:
            answer = med_minus1

        print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys


if __name__ == '__main__':
    n = int(input())
    a_list = list(map(int, input().split()))

    max_a = max(a_list)
    a_list.remove(max_a)

    max_comb = - sys.maxsize
    answer1 = max_a
    answer2 = -1
    for i in range(n-1):
        comb = math.factorial(max_a)/(math.factorial(a_list[i]) * math.factorial(max_a - a_list[i]))
        if max_comb < comb:
            max_comb = comb
            answer2 = a_list[i]

    print(str(answer1) + " " + str(answer2))


Fixed submission:
import math
import sys


if __name__ == '__main__':
    n = int(input())
    a_list = list(map(int, input().split()))

    max_a = max(a_list)
    a_list.remove(max_a)

    min_diff = sys.maxsize
    answer1 = max_a
    answer2 = -1
    for i in range(n-1):
        diff = math.fabs(max_a/2 - a_list[i])
        if min_diff > diff:
            min_diff = diff
            answer2 = a_list[i]

    print(str(answer1) + " " + str(answer2))

Buggy python submission (verdict: Runtime Error):
import math
import sys


if __name__ == '__main__':
    n = int(input())
    a_list = list(map(int, input().split()))

    max_comb = - sys.maxsize
    answer1 = -1
    answer2 = -1
    for i in range(n):
        for j in range(n):
            if i == j:
                continue
            if a_list[i] < a_list[j]:
                continue
            comb = math.factorial(a_list[i])/(math.factorial(a_list[j]) * math.factorial(a_list[i] - a_list[j]))

            if max_comb < comb:
                max_comb = comb
                answer1 = a_list[i]
                answer2 = a_list[j]

    print(str(answer1) + " " + str(answer2))

Fixed submission:
import math
import sys


if __name__ == '__main__':
    n = int(input())
    a_list = list(map(int, input().split()))

    max_a = max(a_list)
    a_list.remove(max_a)

    min_diff = sys.maxsize
    answer1 = max_a
    answer2 = -1
    for i in range(n-1):
        diff = math.fabs(max_a/2 - a_list[i])
        if min_diff > diff:
            min_diff = diff
            answer2 = a_list[i]

    print(str(answer1) + " " + str(answer2))
Buggy python submission (verdict: Runtime Error):
a = int(intput())
b = int(intput())
c = int(intput())
d = int(intput()

print(min(a,b)+min(c,d))

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

print(min(a,b)+min(c,d))
Buggy python submission (verdict: Runtime Error):
def f(N):
    res = 0
    while N//10 >= 1:
        res += N % 10
        N = N // 10
    return res


if __name__ == '__main__':
    N = int(input())

    if N % f(N) == 0:
        print('Yes')
    else:
        print('No')



Fixed submission:
if __name__ == '__main__':
    N = input()

    fn = 0
    for i in range(len(N)):
        fn += int(N[i])

    if int(N) % fn == 0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
def f(N):
    res = 0
    while N//10 > 0:
        res += N % 10
        N = N // 10
    return res


if __name__ == '__main__':
    N = int(input())

    if N % f(N) == 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
if __name__ == '__main__':
    N = input()

    fn = 0
    for i in range(len(N)):
        fn += int(N[i])

    if int(N) % fn == 0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
def f(N):
    res = 0
    while N//10 > 0:
        res += N % 10
        N = N // 10
    return res


if __name__ == '__main__':
    N = int(input())

    if N % f(N) == 0:
        print('Yes')
    else:
        print('No')


Fixed submission:
if __name__ == '__main__':
    N = input()

    fn = 0
    for i in range(len(N)):
        fn += int(N[i])

    if int(N) % fn == 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    N = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(int, input().split())))

    answer = 0
    for a in A:
        for b in [b for b in B if b > a]:
            for c in [c for c in C if c > b]:
                answer += 1
    print(answer)

Fixed submission:
import bisect


if __name__ == '__main__':
    N = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(int, input().split())))

    answer = 0
    for b in B:
        answer += (bisect.bisect_left(A, b)) * (N - bisect.bisect_right(C, b))
    print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

if __name__ == '__main__':
    N, K = map(int, input().split())
    xy_list = [list(map(int, input().split())) for i in range(N)]

    all_x = sorted(list(set([xy[0] for xy in xy_list])))
    all_y = sorted(list(set([xy[1] for xy in xy_list])))

    answer = sys.maxsize
    for i in range(len(all_x)):
        x1 = all_x[i]
        for j in range(i+1, len(all_x)):
            x2 = all_x[j]
            for k in range(len(all_y)):
                y1 = all_y[k]
                for l in range(k+1, len(all_y)):
                    y2 = all_y[l]
                    if K <= len([xy for xy in xy_list if (x1 <= xy[0] <= x2) and (y1 <= xy[1] <= y2)]) and answer > (x2-x1) * (y2-y1):
                        answer = (x2-x1) * (y2-y1)

    print(answer)


Fixed submission:
import sys

if __name__ == '__main__':
    N, K = map(int, input().split())
    xy_list = [list(map(int, input().split())) for i in range(N)]

    all_x = sorted(list(set([xy[0] for xy in xy_list])))
    all_y = sorted(list(set([xy[1] for xy in xy_list])))

    answer = sys.maxsize
    for i in range(len(all_x)):
        x1 = all_x[i]
        for j in range(i+1, len(all_x)):
            x2 = all_x[j]
            for k in range(len(all_y)):
                y1 = all_y[k]
                for l in range(k+1, len(all_y)):
                    y2 = all_y[l]
                    if K <= len([xy for xy in xy_list if (x1 <= xy[0] <= x2) and (y1 <= xy[1] <= y2)]) and answer > (x2-x1) * (y2-y1):
                        answer = (x2-x1) * (y2-y1)

    print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

if __name__ == '__main__':
    N, K = map(int, input().split())
    xy_list = [list(map(int, input().split())) for i in range(N)]

    all_x = sorted(list(set([xy[0] for xy in xy_list])))
    all_y = sorted(list(set([xy[1] for xy in xy_list])))

    answer = sys.maxsize
    for x1 in all_x:
        for x2 in [x2 for x2 in all_x if x2 > x1]:
            for y1 in all_y:
                for y2 in [y2 for y2 in all_y if y2 > y1]:
                    if K <= len([xy for xy in xy_list if (x1 <= xy[0] <= x2) and (y1 <= xy[1] <= y2)]) and answer > (x2-x1) * (y2-y1):
                        answer = (x2-x1) * (y2-y1)

    print(answer)

Fixed submission:
import sys

if __name__ == '__main__':
    N, K = map(int, input().split())
    xy_list = [list(map(int, input().split())) for i in range(N)]

    all_x = sorted(list(set([xy[0] for xy in xy_list])))
    all_y = sorted(list(set([xy[1] for xy in xy_list])))

    answer = sys.maxsize
    for i in range(len(all_x)):
        x1 = all_x[i]
        for j in range(i+1, len(all_x)):
            x2 = all_x[j]
            for k in range(len(all_y)):
                y1 = all_y[k]
                for l in range(k+1, len(all_y)):
                    y2 = all_y[l]
                    if K <= len([xy for xy in xy_list if (x1 <= xy[0] <= x2) and (y1 <= xy[1] <= y2)]) and answer > (x2-x1) * (y2-y1):
                        answer = (x2-x1) * (y2-y1)

    print(answer)
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce


def lcm(a,b):
    return (a*b)//math.gcd(a,b)


def lcm_list(a):
    return reduce(lcm,a)


if __name__ == '__main__':
    n = int(input())
    t = [int(input()) for i in range(n)]

    print(lcm_list(t))


Fixed submission:
import fractions
from functools import reduce


def lcm(a,b):
    return (a*b)//fractions.gcd(a,b)


def lcm_list(a):
    return reduce(lcm,a)


if __name__ == '__main__':
    n = int(input())
    t = [int(input()) for i in range(n)]

    print(lcm_list(t))
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(1,N+1) :
        ans *= i
    ans %= 1000000007
    print(ans)


Fixed submission:
if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(1,N+1) :
        ans *= i
        # 剰余演算の分配則
        ans %= 1000000007
    ans %= 1000000007
    print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
fn = math.factorial(N)
ans = int(math.factorial(N)%(math.pow(10,9)+7))
print(ans)

Fixed submission:
if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(1,N+1) :
        ans *= i
        # 剰余演算の分配則
        ans %= 1000000007
    ans %= 1000000007
    print(ans)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
h=int(input())

print(((a+b)＊h)//2)

Fixed submission:
a=int(input())
b=int(input())
h=int(input())
 
print(((a+b)*h)//2)
Buggy python submission (verdict: Runtime Error):
i=input()
l=int(i[-1])

if l==3:
  print(bon)
elif l==0 or l==1 or l==6 or l==8:
  print(pon)
else:
  print(hon)

Fixed submission:
i=input()
l=int(i[-1])

if l==3:
  print('bon')
elif l==0 or l==1 or l==6 or l==8:
  print('pon')
else:
  print('hon')
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())

for i in range(a, b):
    if i%c != 0:
        if i%d !=0:
            print(i)

Fixed submission:
count=0

security=input()
sec_list=list(security)

for s in range(0,len(security)-1):
    if sec_list[s]==sec_list[s+1]:
        count+=1

if count != 0:
    print("Bad")
else:
    print("Good")