Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
book_index = {}
    while True:
        try:
            word, page = input().split(' ')
            page = int(page)
            page_list = book_index.get(word)
            if page_list:
                page_list.append(page)
            else:
                book_index[word] = [page]
        except Exception:
            break

    for k in sorted(book_index.keys()):
        print(k)
        print(' '.join(map(str, (sorted(book_index.get(k))))))

Fixed submission:
book_index = {}
while True:
    try:
        word, page = input().split(' ')
        page = int(page)
        page_list = book_index.get(word)
        if page_list:
            page_list.append(page)
        else:
            book_index[word] = [page]
    except Exception:
        break

for k in sorted(book_index.keys()):
    print(k)
    print(' '.join(map(str, (sorted(book_index.get(k))))))
Buggy python submission (verdict: Time Limit Exceeded):
while True:
    num = int(input())

    index = 1
    for n in range(1, num):
        index += 1

        while True:
            str_index = str(index)
            if '4' in str_index or '6' in str_index:
                index += 1
            else:
                break

    print(index)

Fixed submission:
""" Created by Jieyi on 9/20/16. """


def main():
    while True:
        num = int(input())
        if num == 0:
            break

        num = str(oct(num)[2:])
        ans = num.translate(str.maketrans('4567', '5789'))
        print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
while True:
    n = int(input())
    t = []
    s = 0
    sum = 0

    if n == 0:
        break

    else:
        for i in range(n):
            s = int(input())
            if s == 0:
                break
            else:
                t.append(i)
                t[i] = s
                t.sort()

        for m in range(n):
            sum = sum + t[m]*(n-m-1)

        print(sum)



Fixed submission:
while True:
    n = int(input())
    t = []
    s = 0
    sum = 0

    if n == 0:
        break

    else:
        for i in range(n):
            t.append(i)
            t[i] = int(input())
            t.sort()

        for m in range(n):
            sum = sum + t[m]*(n-m-1)

        print(sum)
Buggy python submission (verdict: Runtime Error):

while true:
    (n,m) = map(int,input().split())
    if n == 0 && m == 0:
        break
    is = list(map(int, input().split()))
    best = max [ is[i] + is[j] if not ( i == j) and is[i] + is[j] <= k else -1 for i in range(0:n) for j in range(0:n) ]
    if(best < 0):
        print("NONE")
    else:
        print(best)



Fixed submission:
while True:
    (n,m) = map(int,input().split())
    if n == 0 and m == 0:
        break
    iss = list(map(int, input().split()))
    best = max([ (iss[i] + iss[j] if not ( i == j) and iss[i] + iss[j] <= m else -1) for i in range(0,n) for j in range(0,n) ])
    if(best < 0):
        print("NONE")
    else:
        print(best)

Buggy python submission (verdict: Runtime Error):

while true:
    (n,m) = map(int,input().split())
    if n == 0 and m == 0:
        break
    is = list(map(int, input().split()))
    best = max [ is[i] + is[j] if not ( i == j) and is[i] + is[j] <= k else -1 for i in range(0:n) for j in range(0:n) ]
    if(best < 0):
        print("NONE")
    else:
        print(best)



Fixed submission:
while True:
    (n,m) = map(int,input().split())
    if n == 0 and m == 0:
        break
    iss = list(map(int, input().split()))
    best = max([ (iss[i] + iss[j] if not ( i == j) and iss[i] + iss[j] <= m else -1) for i in range(0,n) for j in range(0,n) ])
    if(best < 0):
        print("NONE")
    else:
        print(best)
Buggy python submission (verdict: Runtime Error):
w,h,x,y,r=map(int,input().split())
print('Yes'if r<=x<=w-r && r<=y<=h-r else'No')

Fixed submission:
w,h,x,y,r=map(int,input().split())
print(['No','Yes'][r<=x<=w-r and r<=y<=h-r])

Buggy python submission (verdict: Runtime Error):
w,h,x,y,r=map(int,input().split())
print(['No','Yes'][r,r<=x,y<=w-r,h-r])

Fixed submission:
w,h,x,y,r=map(int,input().split())
print(['No','Yes'][r<=x<=w-r and r<=y<=h-r])
Buggy python submission (verdict: Runtime Error):
i=0
while((a=int(input())!=0):
      i+=1
      print("Case {0}: {1}".format(i,a))

Fixed submission:
i=0
while 1:
    a=int(input())
    if(a==0): break
    i+=1
    print("Case {0}: {1}".format(i,a))

Buggy python submission (verdict: Runtime Error):
i=0
while 1:
    a=int(input())
    if(a==0)break
    i+=1
    print("Case {0}: {1}".format(i,a))

Fixed submission:
i=0
while 1:
    a=int(input())
    if(a==0): break
    i+=1
    print("Case {0}: {1}".format(i,a))
Buggy python submission (verdict: Runtime Error):
while 1:
    a,b=map(int,input().split())
    if(a==0 and b==0): break
    print(sorted[a,b])

Fixed submission:
while 1:
    a,b=map(int,input().split())
    if(a==0 and b==0): break
    print(min(a,b),max(a,b))
Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
print('{0:.5f} {1:.5f}'.format(math.pi*r*r,math.pi*r*2))

Fixed submission:
import math
r=float(input())
print('{0:.5f} {1:.5f}'.format(math.pi*r*r,math.pi*r*2))

Buggy python submission (verdict: Runtime Error):
import math
r=double(input())
print('{0:.5f} {1:.5f}'.format(math.pi*r*r,math.pi*r*2))

Fixed submission:
import math
r=float(input())
print('{0:.5f} {1:.5f}'.format(math.pi*r*r,math.pi*r*2))
Buggy python submission (verdict: Runtime Error):
n=int(input())
ns=map(int,input().split())
print(min(ns),max(ns),sum(ns))

Fixed submission:
input()
# map returns an iterator rather than a list, 
# and an iterator can traverses the data only once.
# so we need to 'list' here
ns=list(map(int,input().split())) 
print(min(ns),max(ns),sum(ns))
Buggy python submission (verdict: Runtime Error):
while 1:
    n,x=map(int,input().split())
    if n == 0 and x == 0: break
    print(len([1 for a in range(1,n+1), for b in range(a+1,n+1), for c in range(b+1,n+1), a + b + c == x]))

Fixed submission:
while 1:
    n,x=map(int,input().split())
    if n == 0 and x == 0: break
    print(len([1 for a in range(1,n+1) for b in range(a+1,n+1) for c in range(b+1,n+1) if a + b + c == x]))
Buggy python submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, max_size):
        self.max_size = max_size
        self.dat = [i for i in range(self.max_size)]

    def find(self, vertex):
        if self.dat[vertex] is vertex: return vertex
        self.dat[vertex] = self.find(self.dat[vertex])
        return self.dat[vertex]

    def merge(self, child, parent):
        """
        parentとchildをマージして、parentの所属にする
        :param parent:
        :param child:
        :return:
        """
        self.dat[self.find(child)] = self.dat[self.find(parent)]

    def is_same(self, v, w):
        """
        頂点vと頂点wが同じ集合に所属しているか
        :param v:
        :param w:
        :return:
        """
        return self.find(v) == self.find(w)


n, q = map(int, input().split())
uni = UnionFind(n)
while q > 0:
    q -= 1
    com, x, y = map(int, input().split())
    if com is 0:
        uni.merge(x, y)
    else:
        print(1 if uni.is_same(x, y) else 0)



Fixed submission:
import sys


class UnionFind:
    def __init__(self, max_size):
        self.max_size = max_size
        self.dat = [i for i in range(self.max_size)]

    def find(self, vertex):
        if self.dat[vertex] is vertex: return vertex
        self.dat[vertex] = self.find(self.dat[vertex])
        # print("searching : " + str(vertex))
        return self.dat[vertex]

    def merge(self, child, parent):
        """
        parentとchildをマージして、parentの所属にする
        :param parent:
        :param child:
        :return:
        """
        self.dat[self.find(child)] = self.dat[self.find(parent)]

    def is_same(self, v, w):
        """
        頂点vと頂点wが同じ集合に所属しているか
        :param v:
        :param w:
        :return:
        """
        return self.find(v) == self.find(w)


n, q = map(int, input().split())
uni = UnionFind(n)
sys.setrecursionlimit(114514)
while q > 0:
    q -= 1
    com, x, y = map(int, input().split())
    if com is 0:
        uni.merge(x, y)
    else:
        print(1 if uni.is_same(x, y) else 0)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[]
for i in range(n):
    l1=list(map(input().split()))
    l1=l1[::-1]
    l.append(l1)
l=sorted(l)
s=0
for i in range(n):
    s+=l[i][0]*l[i][1]
for i in range(n):
    if m-l[i][1]>=0:
        s-=l[i][0]*l[i][1]
        m-=l[i][1]
    else:
        s-=l[i][0]*m
print(s)


Fixed submission:
b=True
while b:
  n,m=map(int,input().split())
  if n==0 and m==0:
    b=False
    exit
  else:
    l=[]
    for i in range(n):
      l1=list(map(int,input().split()))
      l1=l1[::-1]
      l.append(l1)
    l=sorted(l)
    l=l[::-1]
    s=0
    for i in range(n):
      s+=l[i][0]*l[i][1]
    for i in range(n):
      if m-l[i][1]>=0:
          s-=l[i][0]*l[i][1]
          m-=l[i][1]
      else:
          s-=l[i][0]*m
          break
    print(s)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=list(map(int,input().split()))
l1=[]
for i in range(n-1):
    l1.append(l[i+1]-l[i])
l1=sorted(l1)
for i in range(k-1):
    del l1[-1]
s=0
for i in l1:
    s+=i
print(s)


Fixed submission:
t=int(input())
for j in range(t):
  n,k=map(int,input().split())
  l=list(map(int,input().split()))
  l1=[]
  for i in range(n-1):
      l1.append(l[i+1]-l[i])
  l1=sorted(l1)
  if n<=k:
    print(0)
  else:
    for i in range(k-1):
      del l1[-1]
    s=0
    for i in l1:
        s+=i
    print(s)

Buggy python submission (verdict: Runtime Error):
t=int(input())
for j in range(t):
  n,k=map(int,input().split())
  l=list(map(int,input().split()))
  l1=[]
  for i in range(n-1):
      l1.append(l[i+1]-l[i])
  l1=sorted(l1)
  for i in range(k-1):
    del l1[-1]
  s=0
  for i in l1:
      s+=i
  print(s)


Fixed submission:
t=int(input())
for j in range(t):
  n,k=map(int,input().split())
  l=list(map(int,input().split()))
  l1=[]
  for i in range(n-1):
      l1.append(l[i+1]-l[i])
  l1=sorted(l1)
  if n<=k:
    print(0)
  else:
    for i in range(k-1):
      del l1[-1]
    s=0
    for i in l1:
        s+=i
    print(s)
Buggy python submission (verdict: Runtime Error):
def inserrtionsort(l,n):
  for i in range(1,n):
    v=l[i]
    j=i-1
    while v<l[j] and j>=0:
      l[j+1]=l[j]
      j-=1
    l[j+1]=v
    print(""join(l))
  print("".join(l))
n=list(input())
m=int(input())
inserrtionsort(m,n)


Fixed submission:
def inserrtionsort(l,n):
  for i in range(1,n):
    print(" ".join(l))
    v=l[i]
    j=i-1
    while int(v)<int(l[j]) and j>=0:
      l[j+1]=l[j]
      j-=1
    l[j+1]=v
  print(" ".join(l))
m=int(input())
n=list(input().split())
inserrtionsort(n,m)

Buggy python submission (verdict: Runtime Error):
def inserrtionsort(l,n):
  for i in range(1,n):
    print(" ".join(l))
    v=l[i]
    j=i-1
    while v<l[j] and j>=0:
      l[j+1]=l[j]
      j-=1
    l[j+1]=v
  print(" ".join(l))
m=int(input())
n=list(map(int,input().split()))
inserrtionsort(n,m)


Fixed submission:
def inserrtionsort(l,n):
  for i in range(1,n):
    print(" ".join(l))
    v=l[i]
    j=i-1
    while int(v)<int(l[j]) and j>=0:
      l[j+1]=l[j]
      j-=1
    l[j+1]=v
  print(" ".join(l))
m=int(input())
n=list(input().split())
inserrtionsort(n,m)
Buggy python submission (verdict: Runtime Error):
def selectionsort(l,n):
    c=0
    for i in range(n):
        minj=i
        for j in range(i,n):
            if int(l[i])<int(l[minj]):
               minj=j
        l[j],l[minj]=l[minj],l[j]
        if j!=minj:
          c+=1
    print("".join(l))
    print(c)
n=int(input())
l=list(input())
selectionsort(l,n)


Fixed submission:
def selectionsort(l,n):
    c=0
    for i in range(n):
        minj=i
        for j in range(i,n):
            if int(l[j])<int(l[minj]):
               minj=j
        l[i],l[minj]=l[minj],l[i]
        if i!=minj:
          c+=1
    print(" ".join(l))
    print(c)
n=int(input())
l=list(input().split())
selectionsort(l,n)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l1=sorted(list(map(int,input().split())))
m=int(input())
l2=sorted(list(map(int,input().split())))
def nibutan(a,k):
    l=0
    r=len(a)
    while r>l:
        m=(r+l)//2
        if a[m]==k:
            return m
        elif k<a[m]:
            r=m
        else:
            l=m
    return -1
c=0
for i in l2:
    if nibutan(l1,i)!=-1:
        c+=1
print(c)


Fixed submission:
n=int(input())
l1=sorted(list(map(int,input().split())))
m=int(input())
l2=sorted(list(map(int,input().split())))
def nibutan(a,k):
    l=0
    r=len(a)
    while r>l:
        m=(r+l)//2
        if a[m]==k:
            return m
        elif k<a[m]:
            r=m
        else:
            l=m+1
    return -1
c=0
for i in l2:
    if nibutan(l1,i)!=-1:
        c+=1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
Q,s = [],[]
flag = 0
while(flag==0):
  c = input()
  if c == "end":
    break
  elif c == "extract":
    print(Q.pop(0))
  else:
    s = c.split()
    Q.append(int(s[1]))
    Q.sort(reverse = True)
  


Fixed submission:
import heapq
Q,s = [],[]
flag = 0
while(flag==0):
  c = input()
  if c == "end":
    break
  elif c == "extract":
    print(heapq.heappop(Q) * (-1))
  else:
    s = c.split()
    heapq.heappush(Q, int(s[1])*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
Q,s = [],[]
flag = 0
while(flag==0):
  c = input()
  if c == "end":
    break
  elif c == "extract":
    print(Q.pop(0))
  else:
    s = c.split()
    Q.append(int(s[1]))
    Q.sort(reverse = True)
  


Fixed submission:
import heapq
Q,s = [],[]
flag = 0
while(flag==0):
  c = input()
  if c == "end":
    break
  elif c == "extract":
    print(heapq.heappop(Q) * (-1))
  else:
    s = c.split()
    heapq.heappush(Q, int(s[1])*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
Q,s = [],[]
flag = 0
while(flag==0):
  c = input()
  if c == "end":
    break
  elif c == "extract":
    Q.sort(reverse = True)
    print(Q.pop(0))
  else:
    s = c.split()
    Q.append(int(s[1]))


Fixed submission:
import heapq
Q,s = [],[]
flag = 0
while(flag==0):
  c = input()
  if c == "end":
    break
  elif c == "extract":
    print(heapq.heappop(Q) * (-1))
  else:
    s = c.split()
    heapq.heappush(Q, int(s[1])*(-1))
Buggy python submission (verdict: Runtime Error):
a =int(intput())
a = a**3
print(a)

Fixed submission:
x = int(input())
x = x**3
print(x)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = b**3
print(b)

Fixed submission:
x = int(input())
x = x**3
print(x)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(a*b,(a+b)*2)


Fixed submission:
a=input().split()
b=int(a[1])
a=int(a[0])
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
a=int(a)
b=int(b)
print(a*b,(a+b)*2)


Fixed submission:
a=input().split()
b=int(a[1])
a=int(a[0])
print(a*b,(a+b)*2)
Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
print(r*r*math.pi,2*r*math.pi)



Fixed submission:
import math
r=float(input())
print(r*r*math.pi,2*r*math.pi)

Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
print(r*r*math.pi,2*r*math.pi)



Fixed submission:
import math
r=float(input())
print(r*r*math.pi,2*r*math.pi)
Buggy python submission (verdict: Time Limit Exceeded):

def is_prime(x):
    if x == 2:
        return True
    else:
        if 2 ** (x-1) % x == 1:
            return True
        else:
            return False

def main():
    n = int(input())
    cnt = 0
    for _ in range(n):
        if is_prime(int(input())):
            cnt += 1

    print(cnt)

main()


Fixed submission:
import math
def is_prime(x):
    if x == 1 or x == 2:
        return True

    for idx in range(2, int(math.sqrt(x))+1):
        if x % idx == 0:
            return False

    return True

def main():
    n = int(input())
    cnt = 0
    for _ in range(n):
        if is_prime(int(input())):
            cnt += 1

    print(cnt)

main()

Buggy python submission (verdict: Time Limit Exceeded):

def is_prime(x):
    if x == 2:
        return True
    else:
        if 2 ** (x-1) % x == 1:
            return True
        else:
            return False

def main():
    n = int(input())
    cnt = 0
    for _ in range(n):
        if is_prime(int(input())):
            cnt += 1

    print(cnt)

main()


Fixed submission:
import math
def is_prime(x):
    if x == 1 or x == 2:
        return True

    for idx in range(2, int(math.sqrt(x))+1):
        if x % idx == 0:
            return False

    return True

def main():
    n = int(input())
    cnt = 0
    for _ in range(n):
        if is_prime(int(input())):
            cnt += 1

    print(cnt)

main()
Buggy python submission (verdict: Time Limit Exceeded):
while 1:
	n = int(raw_input())
	if n == 0:
		break
	bridge = [0 for i in range(n)]
	gold = [0 for i in range(n)]
	for i in range(n):
		gold[i], bridge[i] = map(int,raw_input().split(" "))
	dp = {0:0}
	for i in range(n):
		tmp_dp = dict()
		for k,v in dp.iteritems():
			for j in range(n):
				bit = 1 << j
				if (k & bit != 0):
					continue
				if v + gold[j] <= bridge[j]:
					tmp_dp[k|bit] = v + gold[j]
		dp = tmp_dp
	print "Yes" if (2**n - 1) in dp else "No"

Fixed submission:
while 1:
	n = int(raw_input())
	if n == 0:
		break
	land = [map(int,raw_input().split(" ")) for i in range(n)]
	land.sort(key = lambda x:(x[1],x[0]))
	gold = 0
	for i in range(n):
		gold += land[i][0]
		if gold > land[i][1]:
			print "No"
			break
	else:
		print "Yes"

Buggy python submission (verdict: Time Limit Exceeded):
while 1:
	n = int(raw_input())
	if n == 0:
		break
	bridge = [0 for i in range(n)]
	gold = [0 for i in range(n)]
	for i in range(n):
		gold[i], bridge[i] = map(int,raw_input().split(" "))
	dp = {0:0}
	for i in range(n):
		tmp_dp = dict()
		for k,v in dp.iteritems():
			for j in range(n):
				bit = 1 << j
				if (k & bit != 0) or (k|bit in tmp_dp):
					continue
				if v + gold[j] <= bridge[j]:
					tmp_dp[k|bit] = v + gold[j]
		dp = tmp_dp
	print "Yes" if (2**n - 1) in dp else "No"

Fixed submission:
while 1:
	n = int(raw_input())
	if n == 0:
		break
	land = [map(int,raw_input().split(" ")) for i in range(n)]
	land.sort(key = lambda x:(x[1],x[0]))
	gold = 0
	for i in range(n):
		gold += land[i][0]
		if gold > land[i][1]:
			print "No"
			break
	else:
		print "Yes"
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*- 

rank = ["AAA", "AA", "A", "B", "C", "D", "E"]
ref0 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0]
ref1 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0]

while True:
  try:
    t1,t2 = map(float,input().split())
  except EOFError:
    break
  
  #print(len(rank))
  
  for i in range(len(rank)):
    if t1 < ref0[i] and t2 < ref1[i]:
      print(rank[i])
      break
  else:
    print("NA")
  

Fixed submission:
# -*- coding: utf-8 -*- 

rank = ["AAA", "AA", "A", "B", "C", "D", "E"]
ref0 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0]
ref1 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0]

while True:
  try:
    t1,t2 = map(float,raw_input().split())
  except EOFError:
    break
  
  #print(len(rank))
  
  for i in range(len(rank)):
    if t1 < ref0[i] and t2 < ref1[i]:
      print rank[i]
      break
  else:
    print "NA"

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*- 

rank = ["AAA", "AA", "A", "B", "C", "D", "E"]
ref0 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0]
ref1 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0]

while True:
  try:
    t1,t2 = map(float,input().split())
  except EOFError:
    break
  
  #print(len(rank))
  
  for i in range(len(rank)):
    if t1 < ref0[i] and t2 < ref1[i]:
      print(rank[i])
      break
  else:
    print("NA")
  

Fixed submission:
# -*- coding: utf-8 -*- 

rank = ["AAA", "AA", "A", "B", "C", "D", "E"]
ref0 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0]
ref1 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0]

while True:
  try:
    t1,t2 = map(float,raw_input().split())
  except EOFError:
    break
  
  #print(len(rank))
  
  for i in range(len(rank)):
    if t1 < ref0[i] and t2 < ref1[i]:
      print rank[i]
      break
  else:
    print "NA"
Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys

def fib(n):
    if (n == 0):
        return 1
    elif (n == 1):
        return 1
    else :
        return fib(n - 1) + fib(n - 2)

if __name__ == "__main__":
    n = input("input number: ")
    n = int(n)
    #print(type(n))
    print(fib(n))



Fixed submission:

f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input()
    n = int(n)
    #print(type(n))
    print(fib(n))

Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
n  = 45
f = [-1 for i in range(45)]

def fib(n):
    global f

    if (n == 0):
        return 1
    elif (n == 1):
        return 1
    elif(f[n] == -1):
        f[n] = fib(n - 1) + fib(n - 2)

    return f[n]

if __name__ == "__main__":


    n = input("input number: ")
    n = int(n)
    #print(type(n))
    print(fib(n))



Fixed submission:

f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input()
    n = int(n)
    #print(type(n))
    print(fib(n))

Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input("input number: ")
    n = int(n)
    #print(type(n))
    print(fib(n))



Fixed submission:

f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input()
    n = int(n)
    #print(type(n))
    print(fib(n))
Buggy python submission (verdict: Runtime Error):
S = input().replace('^', '**').replace('x', '*1*(x)')[1:]
for i in range(2000, -2001, -1):
    if i == 0: continue

    T = S.replace('x', str(i))
    #print(T, eval(T))
    if eval(T) == 0:
        print('(x{:+})'.format(-i), end='')
else:
    print()



Fixed submission:
S = input().replace('+x', '+1x').replace('-x', '-1x').replace('^', '**').replace('x', '*1*(x)')[1:]
for i in range(2000, -2001, -1):
    if i == 0: continue

    T = S.replace('x', str(i))
    #print(T, eval(T))
    if eval(T) == 0:
        print('(x{:+})'.format(-i), end='')
else:
    print()

Buggy python submission (verdict: Runtime Error):
S = input().replace('+x', '+1x').replace('^', '**').replace('x', '*1*(x)')[1:]
for i in range(2000, -2001, -1):
    if i == 0: continue

    T = S.replace('x', str(i))
    #print(T, eval(T))
    if eval(T) == 0:
        print('(x{:+})'.format(-i), end='')
else:
    print()



Fixed submission:
S = input().replace('+x', '+1x').replace('-x', '-1x').replace('^', '**').replace('x', '*1*(x)')[1:]
for i in range(2000, -2001, -1):
    if i == 0: continue

    T = S.replace('x', str(i))
    #print(T, eval(T))
    if eval(T) == 0:
        print('(x{:+})'.format(-i), end='')
else:
    print()
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(x, y)
x = a * b
y = a + a + b + b


Fixed submission:
a, b = map(int, input().split())
x = a * b
y = a + a + b + b
print(x, y)