Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
MOD = 10**9 + 7
n, m = map(int, input().split())
a = [int(x) for x in sys.stdin.readlines()]
ans = [0 for i in range(n)]
if 1 not in a:
    ans[0] = 1
if 2 not in a and n >=2:
    ans[1] = ans[0] + 1

for i in range(2, n):
    if i+1 not in a:
        ans[i] = (ans[i-1] + ans[i-2])%MOD

print(ans[-1])

Fixed submission:
import sys
MOD = 10**9 + 7
n, m = map(int, input().split())
a = [int(x) for x in sys.stdin.readlines()]
ans = [1 for i in range(n)]
for x in a:
    ans[x-1] = 0
for i in range(n):
    if i == 0 and ans[i] == 0:
        ans[0] = 0
    elif i == 1:
        if ans[i] == 1:
            ans[1] += ans[0]
        elif ans[i] == 0:
            ans[1] = 0
    elif i >= 2 and ans[i] == 1:
        ans[i] = (ans[i-1] + ans[i-2])%MOD

print(ans[-1])

Buggy python submission (verdict: Runtime Error):
import sys
MOD = 10**9 + 7
n, m = map(int, input().split())
a = [int(x) for x in sys.stdin.readlines()]
ans = [0 for i in range(n)]
if 1 not in a:
    ans[0] = 1
if 2 not in a:
    ans[1] = ans[0] + 1

for i in range(2, n):
    if i+1 not in a:
        ans[i] = (ans[i-1] + ans[i-2])%MOD
    else:
        ans[i] = 0

print(ans[-1])

Fixed submission:
import sys
MOD = 10**9 + 7
n, m = map(int, input().split())
a = [int(x) for x in sys.stdin.readlines()]
ans = [1 for i in range(n)]
for x in a:
    ans[x-1] = 0
for i in range(n):
    if i == 0 and ans[i] == 0:
        ans[0] = 0
    elif i == 1:
        if ans[i] == 1:
            ans[1] += ans[0]
        elif ans[i] == 0:
            ans[1] = 0
    elif i >= 2 and ans[i] == 1:
        ans[i] = (ans[i-1] + ans[i-2])%MOD

print(ans[-1])
Buggy python submission (verdict: Runtime Error):
def c(s, cnt):
    tmp = s.count("ABC")
    if tmp == 0:
        print(cnt)
    else:
        cnt += tmp
        s = s.replace("ABC", "BCA")
        c(s, cnt)
s = input()
ans = 0
c(s, ans)

Fixed submission:
s = input().replace("BC", "D")
ans = 0
a = 0
for i in range(len(s)):
    if s[i] == "A":
        a += 1
    elif s[i] == "D":
        ans += a
    else:
        a = 0
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
ans = 0
while s.count("ABC") != 0:
    ans += s.count("ABC")
    s = s.replace("ABC", "BCA")
print(ans)

Fixed submission:
s = input().replace("BC", "D")
ans = 0
a = 0
for i in range(len(s)):
    if s[i] == "A":
        a += 1
    elif s[i] == "D":
        ans += a
    else:
        a = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
def dfs(A):
    global cnt

    if len(A) == n:
        ans = [0 for i in range(m)]
        print(A)
        for i, a in enumerate(A):
            if a:
                for j in range(m):
                    if i+1 in s[j]:
                        ans[j] += 1
        print(ans)
        for x, y in zip(p, ans):
            if x != y%2:
                break
        else:
            cnt += 1
        return
    for v in range(2):
        A.append(v)
        dfs(A)
        A.pop()

n, m = map(int, input().split())
s = [list(map(int, x.split()))[1:]  for x in sys.stdin.readlines()]
p = list(map(int, input().split()))
cnt = 0
dfs([])
print(cnt)

Fixed submission:
def dfs(A):
    global cnt

    if len(A) == n:
        ans = [0 for i in range(m)]
        for i, a in enumerate(A):
            if a:
                for j in range(m):
                    if i+1 in s[j]:
                        ans[j] += 1
        for x, y in zip(p, ans):
            if x != y%2:
                break
        else:
            cnt += 1
        return
    for v in range(2):
        A.append(v)
        dfs(A)
        A.pop()

n, m = map(int, input().split())
s = [list(map(int, input().split()))[1:]  for _ in range(m)]
p = list(map(int, input().split()))
cnt = 0
dfs([])
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

n, m = map(int, input().split())
a = list(map(int, sys.stdin.readline().split()))
a.sort()
for x in sys.stdin.readlines():
    b, c = map(int, x.split())
    if c < a[0]:
        pass
    else:
        for i in range(b):
            if a[i] < c:
                a[i] = c
            else:
                break
        a.sort()
print(sum(a))

Fixed submission:
import sys

n, m = map(int, input().split())
a = list(map(int, sys.stdin.readline().split()))
bc = [ tuple(map(int, x.split())) for x in sys.stdin.readlines()]
bc.sort(key = lambda x:x[1], reverse=True)
bc.append((n,0))
diff = []
for b, c in bc:
    diff += [c] * b
    if len(diff) > n:
        break

a += diff
a.sort()
print(sum(a[-n:]))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
s[k].lower
print(s)

Fixed submission:
n, k = map(int, input().split())
s = input()
ans = ""
for i in range(n):
  if i == k-1: 
    ans += s[i].lower()
  else : ans += s[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()

if 0 < int(s[0:2]) <= 12 and 0 < int(s[2:4]) <= 12 :
  print("AMBIGUOUS")
elif (12 < int(s[0:2]) or int(s[0:2]) == 0) and  0 < int(s[2:4]) <= 12:
  print("YYMM")
elif 0 < int(s[0:2]) <= 12 and (12 < int(s[2:4] or int(s[2:4]) == 0):
  print("MMYY")
else:
  print("NA")

Fixed submission:
s = input()

if 0 < int(s[0:2]) <= 12 and 0 < int(s[2:4]) <= 12 :
  print("AMBIGUOUS")
elif (12 < int(s[0:2]) or int(s[0:2]) == 0) and  0 < int(s[2:4]) <= 12:
  print("YYMM")
elif 0 < int(s[0:2]) <= 12 and (12 < int(s[2:4]) or int(s[2:4]) == 0):
  print("MMYY")
else:
  print("NA")
Buggy python submission (verdict: Time Limit Exceeded):
r, g, b, n = map(int, input().split())
ans = 0
for i in range(n//r+1):
    for j in range(n//g+1):
        for k in range(n//b+1):
            if r*i + j*g + b*k == n:
                ans += 1

print(ans)

Fixed submission:
r, g, b, n = map(int, input().split())
ans = [0 for i in range(n+1)]
ans[0] = 1
for i in [r,g,b]:
    for j in range(n+1-i):
        ans[j+i] += ans[j]

print(ans[n])
Buggy python submission (verdict: Runtime Error):
import sys
from functools import reduce
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n
def gcd_list(numbers):
    return reduce(gcd, numbers)

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
c = [gcd_list(a[:i] + a[i+1:]) for i in range(n%10)]
c.sort()
if n == 2:
    print(c[1])
else:
    print(c[2])

Fixed submission:
import sys
def gcd(m, n):
    if n == 0:
        n, m = m, n
    r = m % n
    return gcd(n, r) if r else n

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
l, r = [0]*(n+1), [0]*(n+1)
for i in range(1, n+1):
    l[i] = gcd(l[i-1], a[i-1])
    r[n-i] = gcd(r[n-i+1], a[n-i])
ans = 0
for i in range(n):
    m = gcd(l[i], r[i+1])
    if ans < m:
        ans = m
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
from functools import reduce
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n
def gcd_list(numbers):
    return reduce(gcd, numbers)

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
c = [gcd_list(a[:i] + a[i+1:]) for i in range(n%4)]
c.sort()
if n == 2:
    print(c[1])
else:
    print(c[2])

Fixed submission:
import sys
def gcd(m, n):
    if n == 0:
        n, m = m, n
    r = m % n
    return gcd(n, r) if r else n

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
l, r = [0]*(n+1), [0]*(n+1)
for i in range(1, n+1):
    l[i] = gcd(l[i-1], a[i-1])
    r[n-i] = gcd(r[n-i+1], a[n-i])
ans = 0
for i in range(n):
    m = gcd(l[i], r[i+1])
    if ans < m:
        ans = m
print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    s, cnt = [0]*n, 0
    for i in a:
        s[i] = abs(i)
        if i < 0:
            cnt += 1
    if cnt%2:
        print(sum(s) - 2*min(s))
    else:
        print(sum(s))

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    s, cnt = [0]*n, 0
    for i in range(n):
        s[i] = abs(a[i])
        if a[i] < 0:
            cnt += 1
    if cnt%2:
        print(sum(s) - 2*min(s))
    else:
        print(sum(s))

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    s = input()
    ans = 10**10
    for i in range(n):
        lc = s[:i+1].count(".")
        rc = s[i:].count("#")
        tmp = n - lc - rc
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    n = int(input())
    s = input()
    white = s.count(".")
    ans, black = white, 0
    for i in range(n):
        if s[i] == ".":
            white -= 1
        else:
            black += 1
        tmp = black + white
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n = [int(input()) for i in range(5)]
for i in range(n):
  if n[i] - n[i+1] > 0:
    print("Yay!")
  else:
    print(":(")

Fixed submission:
n = [int(input()) for i in range(6)]
if max(n[0], n[1], n[2], n[3], n[4]) - min(n[0], n[1], n[2], n[3], n[4]) <= n[5]:
  print("Yay!")  
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
b = input()
if s == "A":
  print("T")
elif s == "C":
  print("G")
elif s == "G":
  print("C")
else:
  print("A")

Fixed submission:
s = input()
if s == "A":
  print("T")
elif s == "C":
  print("G")
elif s == "G":
  print("C")
else:
  print("A")
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
for i in range(q):
    l, r = map(int, input().split())
    print(s[l-1:r].count("AC"))

Fixed submission:
n, q = map(int, input().split())
s = input()
count = [0]*(n+1)
for i in range(1, n):
    count[i] += count[i-1]
    if s[i-1:i+1] == "AC":
      count[i] += 1
for i in range(q):
    l, r = map(int, input().split())
    print(count[r-1] - count[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
l, r = [0]*q, [0]*q
for i in range(q):
    l[i], r[i] = map(int, input().split())
    print(s[l[i]-1:r[i]].count("AC"))

Fixed submission:
n, q = map(int, input().split())
s = input()
count = [0]*(n+1)
for i in range(1, n):
    count[i] += count[i-1]
    if s[i-1:i+1] == "AC":
      count[i] += 1
for i in range(q):
    l, r = map(int, input().split())
    print(count[r-1] - count[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
l, r = [0]*q, [0]*q
for i in range(q):
    l[i], r[i] = map(int, input().split())
for i in range(q):
    print(s[l[i]-1:r[i]].count("AC"))

Fixed submission:
n, q = map(int, input().split())
s = input()
count = [0]*(n+1)
for i in range(1, n):
    count[i] += count[i-1]
    if s[i-1:i+1] == "AC":
      count[i] += 1
for i in range(q):
    l, r = map(int, input().split())
    print(count[r-1] - count[l-1])
Buggy python submission (verdict: Runtime Error):
import sys


class UnionFind:
    def __init__(self, n):
        self.table = [-1] * n

    def _root(self, x):
        stack = []
        tbl = self.table
        while tbl[x] >= 0:
            stack.append(x)
            x = tbl[x]
        for y in stack:
            tbl[y] = x
        return x

    def find(self, x, y):
        return self._root(x) == self._root(y)

    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1 <= d2:
            self.table[r2] = r1
            self.table[r1] += d2
        else:
            self.table[r1] = r2
            self.table[r2] += d1


def main():
    n, m, k = map(int, sys.stdin.buffer.readline().split())
    uf = UnionFind(n)
    fb = [0]*n
    i = 0
    for x in sys.stdin.buffer.readlines():
        if i < m:
            a, b = map(int, x.split())
            fb[a-1] += 1
            fb[b-1] += 1
            uf.union(a-1, b-1)
        else:
            c, d = map(int, x.split())
            fb[c-1] += 1
            fb[d-1] += 1
        i += 1

    ans = [-uf.table[uf._root(i)]-1-fb[i] for i in range(n)]
    print(*ans)


if __name__ == "__main__":
    main()


Fixed submission:
import sys


class UnionFind:
    def __init__(self, n):
        self.table = [-1] * n

    def _root(self, x):
        stack = []
        tbl = self.table
        while tbl[x] >= 0:
            stack.append(x)
            x = tbl[x]
        for y in stack:
            tbl[y] = x
        return x

    def find(self, x, y):
        return self._root(x) == self._root(y)

    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1 <= d2:
            self.table[r2] = r1
            self.table[r1] += d2
        else:
            self.table[r1] = r2
            self.table[r2] += d1


def main():
    n, m = map(int, sys.stdin.buffer.readline().split())
    uf = UnionFind(n)
    ans = [n*(n-1)//2]
    for x in reversed(sys.stdin.buffer.readlines()):
        a, b = map(int, x.split())
        a -= 1
        b -= 1
        if uf.find(a, b):
            ans.append(ans[-1])
            continue
        ba, bb = uf.table[uf._root(a)], uf.table[uf._root(b)]
        ans.append(ans[-1] - ba*bb)
        uf.union(a, b)
    ans.reverse()
    print("\n".join(map(str, ans[1:])))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
if n[1] = n[2]:
  print(min(n[1], n[2]), max(0, n[1] + n[2] - n[0]))


Fixed submission:
n = list(map(int, input().split()))
print(min(n[1], n[2]), max(0, n[1] + n[2] - n[0]))

Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
print(min(n[1], n[2]), max(0, n[1] - n[2a

Fixed submission:
n = list(map(int, input().split()))
print(min(n[1], n[2]), max(0, n[1] + n[2] - n[0]))
Buggy python submission (verdict: Runtime Error):
s = input()
sa = "keyence"
sl = 0
for i in range(len(s)):
    if s[i] == sa[sl]:
        sl += 1
if sl == len(sa) and s[0] == sa[0] and s[-1] == sa[-1]:
    print("YES")
else:
    print("NO")

Fixed submission:
s = input()
for i in range(len(s)):
    if(i > 7):
        continue
    if(s[:i] + s[-(7-i):] == "keyence"):
        print("YES")
        exit()
print("NO")

Buggy python submission (verdict: Runtime Error):
s = input()
sa = 'keyence'
sl = 0
for i in range(len(s)):
    if s[i] == sa[sl]:
        sl += 1
if sl == len(sa) and s[0] == sa[0] and s[-1] == sa[-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
for i in range(len(s)):
    if(i > 7):
        continue
    if(s[:i] + s[-(7-i):] == "keyence"):
        print("YES")
        exit()
print("NO")

Buggy python submission (verdict: Runtime Error):
s = input()
sa = 'keyence'
sl = 0
for i in range(len(s)):
    if s[i] == sa[sl]:
        sl += 1
if sl == len(sa) and s[0] == sa[0] and s[-1] == sa[-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
for i in range(len(s)):
    if(i > 7):
        continue
    if(s[:i] + s[-(7-i):] == "keyence"):
        print("YES")
        exit()
print("NO")

Buggy python submission (verdict: Runtime Error):
s = input()
sa = 'keyence'
sl = 0
for i in range(len(s)):
    if s[i] == sa[sl]:
        sl += 1
if sl == len(sa) and s[0] == sa[0] and s[-1] == sa[-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
for i in range(len(s)):
    if(i > 7):
        continue
    if(s[:i] + s[-(7-i):] == "keyence"):
        print("YES")
        exit()
print("NO")
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    cnt, nega, posi = 0, 0, []
    for x, y in zip(a, b):
        if x < y:
            nega += y - x
            cnt += 1
        else:
            posi.append(x - y)
    posi.sort(reverse=True)
    i = 0
    while nega > 0:
        nega -= posi[i]
        cnt += 1
        i += 1
    print(cnt)

if __name__ == "__main__":
    main()

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt, nega, posi = 0, 0, []
for x, y in zip(a, b):
    if x < y:
        nega += y - x
        cnt += 1
    else:
        posi.append(x - y)
if nega > 0:
    posi.sort(reverse=True)
    for i, x in enumerate(posi):
        nega -= x
        if nega <= 0:
            cnt += i + 1
            break
    else:
        cnt = -1
print(cnt)

Buggy python submission (verdict: Runtime Error):
import collections

n, p = map(int, input().split())
res = []
x = p
y = 2
while y*y <= x:
    while x % y == 0:
        res.append(y)
        x //= y
    y += 1
if x > 1:
    res.append(x)

res = collections.Counter(res)
ans = 1
for d in res.items():
    if d[1] >= n:
        ans *= d[0]**d[1]//n
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt, nega, posi = 0, 0, []
for x, y in zip(a, b):
    if x < y:
        nega += y - x
        cnt += 1
    else:
        posi.append(x - y)
if nega > 0:
    posi.sort(reverse=True)
    for i, x in enumerate(posi):
        nega -= x
        if nega <= 0:
            cnt += i + 1
            break
    else:
        cnt = -1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = set[int(input()) for i in range(3)]
print((n[0] - n[1] + 1) * (n[0] - n[2] + 1) )

Fixed submission:
n = [int(input()) for i in range(3)]
print((n[0] - n[1] + 1) * (n[0] - n[2] + 1) )

Buggy python submission (verdict: Runtime Error):
n = list[int(input()) for i in range(3)]
print((n[0] - n[1] + 1) * (n[0] - n[2] + 1) )

Fixed submission:
n = [int(input()) for i in range(3)]
print((n[0] - n[1] + 1) * (n[0] - n[2] + 1) )
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
ans = 0
while s.count("BW") > 0 :
    ans += s.count("BW")
    s = s.replace("BW", "WB")

print(ans)


Fixed submission:
from scipy.misc import comb
s = input()
n = len(s)
r = s.count("B")
ans = 0
for i in range(r):
  ans += n-i

for i in range(len(s)):
  if s[i] == "B":
    ans -= i+1
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n, m = map(int, input().split())
  P = [None] * m
  Y = [None] * m
  for i in range(m):
    p, y =map(int, input().split())
    P[i] = p
    Y[i] = y
  
  for i in range(m):
    cnt = 1
    for j in range(m):
      if P[i] == P[j] and Y[i] > Y[j]:
        cnt += 1
    print(str(P[i]).zfill(6)+str(cnt).zfill(6))
  
if __name__ == '__main__':
  main()

Fixed submission:
def main():
  n, m = map(int, input().split())
  buf = [None] * m
  cnt = {k: [] for k in range(n + 1)}
  for i in range(m):
      p, y = map(int, input().split())
      cnt[p] += [(y, i)]
  for p, l in cnt.items():
      if not l:
          continue
      l.sort()
      for j, (y, i) in enumerate(l):
          buf[i] = '{:06d}{:06d}'.format(p, j + 1)

  print('\n'.join(buf))

if __name__ == '__main__':
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n, m = map(int, input().split())
  P = [None] * m
  Y = [None] * m
  for i in range(m):
    p, y =map(int, input().split())
    P[i] = p
    Y[i] = y
  
  for i in range(m):
    cnt = 1
    for j in range(m):
      if P[i] == P[j] and Y[i] > Y[j]:
        cnt += 1
    print(str(P[i]).zfill(6)+str(cnt).zfill(6))
  
if __name__ == '__main__':
  main()

Fixed submission:
def main():
  n, m = map(int, input().split())
  buf = [None] * m
  cnt = {k: [] for k in range(n + 1)}
  for i in range(m):
      p, y = map(int, input().split())
      cnt[p] += [(y, i)]
  for p, l in cnt.items():
      if not l:
          continue
      l.sort()
      for j, (y, i) in enumerate(l):
          buf[i] = '{:06d}{:06d}'.format(p, j + 1)

  print('\n'.join(buf))

if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
s = input()
if len(s) <= 2:
  print(s)
else :
  for i in reversed(s)
  print(i)

Fixed submission:
s = input()
if len(s) <= 2:
  print(s)
else :
  print(s[::-1])
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
n, m = map(int, input().split())
s = input()
t = input()
l = n*m//fractions.gcd(n, m)
a, b = l//n, l//m
x = ["" for i in range(l)]
for i in range(n):
    x[a*i] = s[i]
for j in range(m):
    if x[b*j] != "" and x[b*j] != t[j]:
        print(-1)
        exit()
print(l)

Fixed submission:
import fractions
n, m = map(int, input().split())
s = input()
t = input()
l = fractions.gcd(n, m)
a, b = n//l, m//l
for i in range(l):
    if t[b*i] != s[a*i]:
        print(-1)
        exit()
print(a*b*l)
Buggy python submission (verdict: Runtime Error):
n, T= map(int, input().split())
m = 1001
for i in range(n):
  c, t = map(int, input().split())
  if t < T:
    m = min(c, m)
if m == 1001:
  print("TLE")
else:
  print(m)

Fixed submission:
n = int(input())
if n ==1 :
  print("Hello World")
else :
  a = [int(input()) for i in range(n)]
  print(a[0] + a[1])

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n ==1 :
  print("Hello World")
else :
  a = [input() for i in range(2)]
  print(a[o]+ a[1])

Fixed submission:
n = int(input())
if n ==1 :
  print("Hello World")
else :
  a = [int(input()) for i in range(n)]
  print(a[0] + a[1])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [input() for i in range(n)]
if n ==1 :
  print("Hello World")
else :
  print(a[o]+ a[1])

Fixed submission:
n = int(input())
if n ==1 :
  print("Hello World")
else :
  a = [int(input()) for i in range(n)]
  print(a[0] + a[1])
Buggy python submission (verdict: Runtime Error):
n, t= map(int, input().split())
m = 1001
for i in range(n):
  c, t = map(int, input().split())
  if t < T:
    m = min(c, m)
print(c)

Fixed submission:
n, T= map(int, input().split())
m = 1001
for i in range(n):
  c, t = map(int, input().split())
  if t <= T:
    m = min(c, m)
if m == 1001:
  print("TLE")
else:
  print(m)
Buggy python submission (verdict: Runtime Error):
def divisor(n):
    i = 1
    res = []
    for i in range(1, n**.5 + 1)
        if n%i == 0:
            res.append(i)
            if n//i not in res:
                res.append(n//i)
    res.sort(reverse=True)
    return res

def main():
    n, m = map(int, input().split())
    md = divisor(m)
    for i in md:
        if i*n <= m:
            print(i)
            exit()

if __name__ == '__main__':
    main()

Fixed submission:
def divisor(n):
    i = 1
    res = []
    while i*i <= n:
        if n%i == 0:
            res.append(i)
            if n//i not in res:
                res.append(n//i)
        i += 1
    res.sort()
    return res

def main():
    n, m = map(int, input().split())
    md = divisor(m)
    ans = 0
    for i in md:
        if (m - n*i)%i == 0 and (m - n*i) >= 0:
            ans = i
        else:
            break
    print(ans)

if __name__ == '__main__':
    main()