Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    from functools import reduce
    from math import gcd
    from collections import deque

    n, *a = map(int, open(0).read().split())
    p = deque(a)
    edge1 = reduce(gcd, a[1:])
    edge2 = reduce(gcd, a[:-1])
    full = reduce(gcd, a)
    ans = max([edge1, edge2, full])
    gl = p.pop()
    tmp = gl
    for i in range(n - 2):
        tmp2 = p.pop()
        gr = reduce(gcd, p)
        gl = gcd(gl, tmp)
        tmp = tmp2
        g = gcd(gl, gr)
        ans = max(ans, g)

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
a,b,t=map(int,input().split())
print(t//a*b)

Buggy python submission (verdict: Runtime Error):
def main():
    from functools import reduce
    from fractions import gcd
    from collections import deque

    n, *a = map(int, open(0).read().split())
    p = deque(a)
    edge1 = reduce(gcd, a[1:])
    edge2 = reduce(gcd, a[:-1])
    full = reduce(gcd, a)
    ans = max([edge1, edge2, full])
    gl = p.pop()
    tmp = gl
    for i in range(n - 2):
        tmp2 = p.pop()
        gr = reduce(gcd, p)
        gl = gcd(gl, tmp)
        tmp = tmp2
        g = gcd(gl, gr)
        ans = max(ans, g)

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
a,b,t=map(int,input().split())
print(t//a*b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
c=sum(max(h[:i])<=h[i] for i in range(n))
print(c)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
c=sum(max(h[:i])<=h[i] for i in range(1,n))+1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
i=0
s,t=0,10*i
for _ in range(5):
  s=s+int(input())
  while(s>t):
    i+=1
  s=t+10
print(s)

Fixed submission:
t=[int(input()) for _ in range(5)]
v=[10*(i//10) if i%10==0 else 10*(i//10+1) for i in t]
w=max(x-y for x,y in zip(v,t))
print(sum(v)-w)
Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
ans = 0
for i in range(N):
  for j in range(i, N):
    for c in S[i:j+1]:
    if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
      ans = max(ans, j - i + 1)
print(ans)

Fixed submission:
S = input()
N = len(S)
ans = 0
for i in range(N):
  for j in range(i, N):
    if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
      ans = max(ans, j - i + 1)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import re

    n, q, s, *lr = open(0).read().split()
    *l, =  map(int, lr[::2])
    *r, = map(int, lr[1::2])
    n = int(n)
    memo = [[None for _ in range(n + 1)] for _ in range(n + 1)]
    for i, j in zip(l, r):
        if memo[i][j] is not None:
            print(memo[i][j])
        else:
            m = re.findall('AC', s[i - 1:j])
            memo[i][j] = len(m)
            print(len(m))


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    from itertools import accumulate

    n, q, s, *lr = open(0).read().split()
    n = int(n)
    *l, = map(int, lr[::2])
    *r, = map(int, lr[1::2])
    c = [1 if s[i] == 'C' and s[i - 1] == 'A' else 0 for i in range(n)]
    a = list(accumulate(c))
    ans = ''
    for i,j in zip(l,r):
        ans += str(a[j-1]-a[i-1]) + '\n'
    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
count  = 0
for _ in range(n):
  a = list(map(int,input().split()))
  if sum(a*b) + c > 0
  	count += 1
print(count)

Fixed submission:
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
count  = 0
for _ in range(n):
  a = list(map(int,input().split()))
  s = sum([x*y for x,y in zip(a,b)]) + c
  if s > 0:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=0
for _ in range(n):
  a,b=input().split()
  if str(b)="JPY":
    s+=int(a)
  else:
    s+=int(a)*380000
print(s)

Fixed submission:
n=int(input())
s=0
for _ in range(n):
  a,b=input().split()
  if str(b)=="JPY":
    s+=int(a)
  else:
    s+=float(a)*380000
print(s)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
s0 = set(input().split())
for _ in range(n-1):
  s = set(input(split()))
  s0 &= s
print(len(s0))

Fixed submission:
n,m=map(int,input().split())
k,*s0=map(int,input().split())
s0 = set(s0)
for _ in range(n-1):
  k,*s = map(int,input().split())
  s = set(s)
  s0 &= s
print(len(s0))
Buggy python submission (verdict: Runtime Error):
def main():
    n, m, *a = map(int, open(0).read().split())
    t = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
    a.sort(reverse=True)

    dp = [-float('Inf')] * (n + 1)
    dp[0] = 0
    for i in range(2, n + 1):
        for j in a:
            dp[i] = max(dp[i], dp[i - t[j]] + 1)

    nums = []
    k = dp[n]
    while n:
        for x in a:
            if dp[n - t[x]] == k - 1:
                nums.append(x)
                n -= t[x]
                break
        k -= 1

    ans = ''.join(map(str, nums))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, m, *a = map(int, open(0).read().split())
    t = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
    a.sort(reverse=True)

    dp = [-float('Inf')] * (n + 10)
    dp[0] = 0
    for i in range(2, n + 1):
        for j in a:
            dp[i] = max(dp[i], dp[i - t[j]] + 1)

    nums = []
    k = dp[n]
    while n:
        for x in a:
            if dp[n - t[x]] == k - 1:
                nums.append(x)
                n -= t[x]
                break
        k -= 1

    ans = ''.join(map(str, nums))
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
m = max(l)
s = sum(l)
if m < s:
  print(Yes)
else:
  print(No)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
m = max(l)
s = sum(l)-m
if m < s:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from itertools import zip_longest
    from bisect import bisect_left
    n, k, *a = map(int, open(0).read().split())
    a.append(k)
    *b, = map(lambda x: bin(x)[2:].zfill(len(bin(max(a))) - 2), a)

    f = False
    m = ''
    for t in zip_longest(*b):
        g = t[-1]
        i = bisect_left(sorted(list(t[:-1])), '1')
        h = '1' if i > n / 2 else '0'
        if (f, g, h) == (False, '1', '0'):
            f = True
        if f:
            m += h
        else:
            m += g

    x = int(m, 2)
    ans = sum(x ^ i for i in a[:-1])
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, k, *a = map(int, open(0).read().split())

    cnt = [sum((x >> i) & 1 for x in a) for i in range(40)]
    bits = [0 if i > n - i else 1 for i in cnt]

    base = format(k, 'b')
    l = len(base)
    tmp = []

    if sum(2 ** i for i, b in enumerate(bits[:l]) if b == 1) > k:
        for i in range(l - 1, -1, -1):
            if int(base[-i - 1]) < bits[i]:
                bits[i] = 0
                tmp.append(sum(2 ** j for j, b in enumerate(bits[:l]) if b == 1))
    else:
        tmp.append(sum(2 ** j for j, b in enumerate(bits[:l]) if b == 1))

    ans = max(sum(i ^ x for x in a) for i in tmp if i <= k)
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from itertools import zip_longest
    n, k, *a = map(int, open(0).read().split())
    a.append(k)
    *b, = map(lambda x: bin(x)[2:].zfill(len(bin(max(a))) - 2), a)

    f = False
    m = ''
    for t in zip_longest(*b):
        g = t[-1]
        h = '0' if t[:-1].count('1') > n / 2 else '1'
        if (f, g, h) == (False, '1', '0'):
            f = True
        if f:
            m += h
        else:
            m += g

    x = int(m, 2)
    ans = sum(x ^ i for i in a[:-1])
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, k, *a = map(int, open(0).read().split())

    cnt = [sum((x >> i) & 1 for x in a) for i in range(40)]
    bits = [0 if i > n - i else 1 for i in cnt]

    base = format(k, 'b')
    l = len(base)
    tmp = []

    if sum(2 ** i for i, b in enumerate(bits[:l]) if b == 1) > k:
        for i in range(l - 1, -1, -1):
            if int(base[-i - 1]) < bits[i]:
                bits[i] = 0
                tmp.append(sum(2 ** j for j, b in enumerate(bits[:l]) if b == 1))
    else:
        tmp.append(sum(2 ** j for j, b in enumerate(bits[:l]) if b == 1))

    ans = max(sum(i ^ x for x in a) for i in tmp if i <= k)
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[input(),input(),input()]
c=0
for x in zip(*l):
  if len(set(x))==3:
    c+=2
  elif len(et(x))==2:
    c+=1
print(c)


Fixed submission:
n=int(input())
l=[input(),input(),input()]
c=0
for x in zip(*l):
  if len(set(x))==3:
    c+=2
  elif len(set(x))==2:
    c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
def main():
  
  n,w=map(int,input().split())
  item=[[0,0]]+[list(map(int,input().split())) for _ in range(n)]
  DP=[[0]*(w+1) for _ in range(n+1)]
  for i in range(n+1):
    weight=item[i][0]
    value=item[i][1]
    for j in range(w+1):
      if j<weight:
        DP[i][j]=DP[i-1][j]
      else:
        DP[i][j]=max(DP[i-1][j],DP[i-1][j-weight]+value)
        
  print(DP[n][w])
      
if __name__=="__main__":
  main()

Fixed submission:
n=int(input())
h=[10**6]+list(map(int,input().split()))
c=[0]*(n+1)
for i in range(2,n+1):
  a=c[i-1]+abs(h[i]-h[i-1])
  b=c[i-2]+abs(h[i]-h[i-2])
  c[i]=min(a,b)
print(c[n])

Buggy python submission (verdict: Runtime Error):
n,w=map(int,input().split())
goods=[list(map(int,input().split())) for _ in range(n)]
DP=[[0]*(w+1) for _ in range(n+1)]
for i in list(range(n))[::-1]:
  wi,vi=goods[i][0],goods[i][1]
  for j in range(w+1):
    if j<wi:
      DP[i][j]=DP[i+1][j]
    else:
      DP[i][j]=max(DP[i+1][j],DP[i+1][j-wi]+vi)
print(DP[0][w])

Fixed submission:
n=int(input())
h=[10**6]+list(map(int,input().split()))
c=[0]*(n+1)
for i in range(2,n+1):
  a=c[i-1]+abs(h[i]-h[i-1])
  b=c[i-2]+abs(h[i]-h[i-2])
  c[i]=min(a,b)
print(c[n])

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
hs = list(map(int, input().split()))
dp=[0]*n
dp[0]=0
for i, hi in enumerate(hs):
    if i == 0:
        continue
    s = max(0, i-k)
    dp[i] = min([ml + abs(hl - hi) for ml, hl in zip(dp[s:i], hs[s:i])])
print(dp[-1])


Fixed submission:
n=int(input())
h=[10**6]+list(map(int,input().split()))
c=[0]*(n+1)
for i in range(2,n+1):
  a=c[i-1]+abs(h[i]-h[i-1])
  b=c[i-2]+abs(h[i]-h[i-2])
  c[i]=min(a,b)
print(c[n])
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for _ in range(n)]
print(sum(l)-max(l)/2)

Fixed submission:
d=int(input())
if d==25:
  print("Christmas")
elif d==24:
  print("Christmas Eve")
elif d==23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
n = input()
l = [int(input()) for _ in range(n)]
print(sum(l)-max(l)/2)

Fixed submission:
n = int(input())
l = [int(input()) for _ in range(n)]
print(sum(l)-int(max(l)/2))
Buggy python submission (verdict: Runtime Error):
def is_prime(n):
    d = n - 1
    d = d // (d & -d)
    L = [2, 7, 61] if n < 1 << 32 else [2, 3, 5, 7, 11, 13, 17] if n < 1 << 48 else [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
    for a in L:
        t = d
        y = pow(a, t, n)
        if y == 1:
            continue
        while y != n - 1:
            y = y * y % n
            if y == 1 or t == n - 1: return 0
            t <<= 1
    return 1


def prime_factor(n):
    if n == 1:
        return {1: 1}

    pf = dict()
    r = list(range(2, n + 1))

    while n != 1:
        x = r[0]
        cnt = 0
        while n % x == 0:
            n = n // x
            cnt += 1
        if cnt > 0:
            pf[x] = cnt
        r = list(filter(lambda y: y % x != 0, r))

    return pf


def main():
    from fractions import factorial as f
    from collections import defaultdict
    n = int(input())
    d = defaultdict(int)
    for i in range(1, n + 1):
        p = prime_factor(i)
        for k, v in p.items():
            d[k] += v
    
    f2_, f4_, f14_, f24_, f74_ = 0, 0, 0, 0, 0
    for i in d.values():
        if i >= 2:
            f2_ += 1
        if i >= 4:
            f4_ += 1
        if i >= 14:
            f14_ += 1
        if i >= 24:
            f24_ += 1
        if i >= 74:
            f74_ += 1

    ans = f74_ + f24_ * (f2_ - 1) + f14_ * (f4_ - 1) + f4_ * (f4_ - 1) * (f2_ - 2) // 2
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def is_prime(n):
    d = n - 1
    d = d // (d & -d)
    L = [2, 7, 61] if n < 1 << 32 else [2, 3, 5, 7, 11, 13, 17] if n < 1 << 48 else [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
    for a in L:
        t = d
        y = pow(a, t, n)
        if y == 1:
            continue
        while y != n - 1:
            y = y * y % n
            if y == 1 or t == n - 1: return 0
            t <<= 1
    return 1


def prime_factor(n):
    if n == 1:
        return {1: 1}

    pf = dict()
    r = list(range(2, n + 1))

    while n != 1:
        x = r[0]
        cnt = 0
        while n % x == 0:
            n = n // x
            cnt += 1
        if cnt > 0:
            pf[x] = cnt
        r = list(filter(lambda y: y % x != 0, r))

    return pf


def main():
    from collections import defaultdict
    n = int(input())
    d = defaultdict(int)
    for i in range(1, n + 1):
        p = prime_factor(i)
        for k, v in p.items():
            d[k] += v
    
    f2_, f4_, f14_, f24_, f74_ = 0, 0, 0, 0, 0
    for i in d.values():
        if i >= 2:
            f2_ += 1
        if i >= 4:
            f4_ += 1
        if i >= 14:
            f14_ += 1
        if i >= 24:
            f24_ += 1
        if i >= 74:
            f74_ += 1

    ans = f74_ + f24_ * (f2_ - 1) + f14_ * (f4_ - 1) + f4_ * (f4_ - 1) * (f2_ - 2) // 2
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n,t,a=int(input()),map(int,input().split())
h=list(map(int,input().split()))
print(min(h).index()+1)

Fixed submission:
n=int(input()),
t,a=map(int,input().split())
h=list(map(int,input().split()))
x=[abs(a-t+0.006*i) for i in h]
print(x.index(min(x))+1)
Buggy python submission (verdict: Runtime Error):
def main():
    from math import gcd
    import sys

    n, m = map(int, input().split())
    s, t = input(), input()
    l = n * m // gcd(n, m)
    a = [l // n * i + 1 for i in range(n)]
    b = [l // m * i + 1 for i in range(m)]
    c = set(a) & set(b)
    for x in list(c):
        i = a.index(x)
        j = b.index(x)

        if s[i] != t[j]:
            print(-1)
            exit()
    else:
        print(l)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    from fractions import gcd

    n, m = map(int, input().split())
    s, t = input(), input()
    l = n * m // gcd(n, m)
    a = [l // n * i + 1 for i in range(n)]
    b = [l // m * i + 1 for i in range(m)]
    c = set(a) & set(b)
    for x in list(c):
        i = a.index(x)
        j = b.index(x)

        if s[i] != t[j]:
            print(-1)
            exit()
    else:
        print(l)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from fractions import gcd
    import sys

    n, m = map(int, input().split())
    s, t = input(), input()
    l = n * m // gcd(n, m)
    a = [l // n * i + 1 for i in range(n)]
    b = [l // m * i + 1 for i in range(m)]
    c = set(a) & set(b)
    for x in list(c):
        i = a.index(x)
        j = b.index(x)

        if s[i] != t[j]:
            print(-1)
            exit()
    else:
        print(l)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    from fractions import gcd

    n, m = map(int, input().split())
    s, t = input(), input()
    l = n * m // gcd(n, m)
    a = [l // n * i + 1 for i in range(n)]
    b = [l // m * i + 1 for i in range(m)]
    c = set(a) & set(b)
    for x in list(c):
        i = a.index(x)
        j = b.index(x)

        if s[i] != t[j]:
            print(-1)
            exit()
    else:
        print(l)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, m = map(int, input().split())
    ans = 1
    v = m / n
    for i in range(2, int(m / n) + 1):
        if m % i == 0:
            ans = max(i, ans)

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, m = map(int, input().split())
    for i in range(int(m / n), 0, -1):
        if m % i == 0:
            print(i)
            break


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    from math import gcd
    n, m = map(int, input().split())

    if gcd(n, m) == 1:
        print(1)
        exit()

    l = int(m / n)
    for i in range(l, 1, -1):
        p, q = divmod(m, i)
        if q != 0 or p < n:
            continue

        print(i)
        break


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, m = map(int, input().split())
    for i in range(int(m / n), 0, -1):
        if m % i == 0:
            print(i)
            break


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from fractions import gcd
    n, m = map(int, input().split())
    ans = 1
    l = int(m / n)
    for i in range(2, l + 1):
        p, q = divmod(m, i)
        if q != 0 or p < n:
            continue

        ans = max(ans, i)

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, m = map(int, input().split())
    for i in range(int(m / n), 0, -1):
        if m % i == 0:
            print(i)
            break


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    from math import gcd
    n, m = map(int, input().split())
    ans = 1
    l = int(m / n)
    for i in range(2, l + 1):
        p, q = divmod(m, i)
        if q != 0 or p < n:
            continue

        ans = max(ans, i)

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, m = map(int, input().split())
    for i in range(int(m / n), 0, -1):
        if m % i == 0:
            print(i)
            break


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
print(111 if (int(input())//111)==0 else 111*(int(input())//111+1) )

Fixed submission:
n=int(input())
print(n if n%111==0 else 111*(n//111+1) )
Buggy python submission (verdict: Runtime Error):
l = sorted(list(str,input().split()))
m = int(l[0]) + int(l[2]+l[1])
print(m)

Fixed submission:
a,b,c = sorted(map(int,input().split()))
print(10*c+b+a)
Buggy python submission (verdict: Runtime Error):
n,m,x,y=map(int,input())
a=max(list(map(int,input().split())))
b=min(list(map(int,input().split())))
print("No War" if a<b and x<b else "War")

Fixed submission:
n,m,x,y=map(int,input().split())
a=max(list(map(int,input().split())))
b=min(list(map(int,input().split())))
print("No War" if a<b and x<b and a<y else "War")
Buggy python submission (verdict: Runtime Error):
def main():
    import fraactions
    from functools import reduce

    n, x, *l = map(int, open(0).read().split())
    a = list(map(lambda i: abs(i-x), l))
    ans = reduce(fractions.gcd, a)
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import fractions
    from functools import reduce

    n, x, *l = map(int, open(0).read().split())
    a = list(map(lambda i: abs(i-x), l))
    ans = reduce(fractions.gcd, a)
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    import math
    from functools import reduce

    n, x, *l = map(int, open(0).read().split())
    a = list(map(lambda i: abs(i-x), l))
    ans = reduce(math.gcd, a)
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import fractions
    from functools import reduce

    n, x, *l = map(int, open(0).read().split())
    a = list(map(lambda i: abs(i-x), l))
    ans = reduce(fractions.gcd, a)
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#include <iostream>

using namespace std;

int main()
{
    long long n, k;
    cin >> n >> k;

    long long a = n / k, b = n / (k / 2) - a;
    long long c = a * a * a, d = b * b * b;
    if (k % 2 == 1)
        cout << c << endl;
    else
        cout << c + d << endl;
}


Fixed submission:
def main():
    n, k = map(int, input().split())
    x = sum(2 * i % k == 0 for i in range(1, k))
    a, b = n // k, n % k
    y = sum(2 * i % k == 0 for i in range(k * a + 1, k * a + b + 1))
    c = x * a + y
    ans = (x * a + y) ** 3 + a ** 3
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    n, k, *x = map(int, open(0).read().split())
    ans = min([x[i + k - 1] - x[i] + min(abs(x[i + k - 1]), abs(x[i])) for i in range(n - k)])
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, k, *x = map(int, open(0).read().split())
    f = lambda i: x[i + k - 1] - x[i] + min(abs(x[i + k - 1]), abs(x[i]))
    l = f(0)

    for i in range(n - k + 1):
        y = f(i)
        if y < l:
            l = y

    print(l)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
r=int(input())
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  orint("AGC")

Fixed submission:
r=int(input())
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")
Buggy python submission (verdict: Runtime Error):
s=str(input())
y="".join([s[i] for i in range(0,len(s),w)])
print(y)

Fixed submission:
s,w=str(input()),int(input())
y="".join([s[i] for i in range(0,len(s),w)])
print(y)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print((b-a-1)(b-a-2)/2)

Fixed submission:
a,b=map(int,input().split())
print((b-a)*(b-a+1)//2-b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
c9 = 0
m = n
while(m>1):
  m = m//9
  if m !== 0: 
  	pass
  else:
    c9 += 1
m = n - 9**c9

c6 = 0
while(m>1):
  m = m//9
  if m !== 0: 
  	pass
  else:
    c6 += 1
    
c1 = n - (9**c9+c6**c6)
print(c9+c6+c1) 

Fixed submission:
def main():
    n = int(input())
    m = [10 ** 5 for _ in range(n + 1)]
    m[0] = 0
    for i in range(1, n + 1):
        j = 0
        while i - 6 ** j >= 0:
            m[i] = min(1 + m[i - 6 ** j], m[i])
            j += 1
        j = 0
        while i - 9 ** j >= 0:
            m[i] = min(1 + m[i - 9 ** j], m[i])
            j += 1

    print(m[-1])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=0
for x in range(n//2):
  y=n-x
  x,y=list(x),list(y)
  z=sum(list(map(int,x)))+sum(list(map(int,y)))
  m=max(m,z)
print(m)

Fixed submission:
n=int(input())
m=100000
for x in range(1,n//2+1):
  y=n-x
  x,y=list(str(x)),list(str(y))
  z=sum(list(map(int,x)))+sum(list(map(int,y)))
  m=min(m,z)
print(m)
Buggy python submission (verdict: Runtime Error):
n,s=int(input()),list(input())
c=0
for i in range(len(s)):
  h=len(set(s[:i])&(s[i:]))
  c=max(c,h)
print(c)

Fixed submission:
n,s,c=int(input()),list(input()),0
for i in range(n):
  h=len(set(s[:i])&set(s[i:]))
  c=max(c,h)
print(c)
Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split()),int(input())
print((a+b+c-max(a,b,c))+max(a,b,c)*2**k)

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