Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
def input():
    return sys.stdin.readline()[:-1]


def main():

    S = input()
    T = input()
    len_T = len(T)
    idx = -1
    for i in range(2**len_T):
        tmp = []
        for j in range(len_T):
            if i>>j & 1:
                tmp.append(T[j])
            else:
                tmp.append('?')
        idx = max(idx, S.rfind(''.join(tmp)))
    if idx == -1:
        print('UNRESTORABLE')
    else:
        ans = list(S.replace('?','a'))
        for i,t in enumerate(T):
            ans[idx+i] = t
        print(''.join(ans))

if __name__ == "__main__":
    main()


Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

def match(s, t, lt, offset):
    for i in range(lt):
        if t[i] != s[offset+i] and s[offset+i] != '?':
            return False
    return True

def main():
    S = input()
    T = input()
    len_S = len(S)
    len_T = len(T)
    ans = list(S.replace('?','a'))
    for i in range(len_S-len_T+1):
        offset = len_S-len_T-i
        if match(S, T, len_T, offset):
            for j in range(len_T):
                ans[offset+j] = T[j]
            break
    else:
        print('UNRESTORABLE')
        exit()
    print(''.join(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
def input():
    return sys.stdin.readline()[:-1]


def main():

    S = input()
    T = input()
    len_T = len(T)
    idx = -1
    for i in range(2**len_T):
        tmp = []
        for j in range(len_T):
            if i>>j & 1:
                tmp.append(T[j])
            else:
                tmp.append('?')
        idx = max(idx, S.rfind(''.join(tmp)))
    if idx == -1:
        print('UNRESTORABLE')
    else:
        ans = list(S.replace('?','a'))
        for i,t in enumerate(T):
            ans[idx+i] = t
        print(''.join(ans))

if __name__ == "__main__":
    main()


Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

def match(s, t, lt, offset):
    for i in range(lt):
        if t[i] != s[offset+i] and s[offset+i] != '?':
            return False
    return True

def main():
    S = input()
    T = input()
    len_S = len(S)
    len_T = len(T)
    ans = list(S.replace('?','a'))
    for i in range(len_S-len_T+1):
        offset = len_S-len_T-i
        if match(S, T, len_T, offset):
            for j in range(len_T):
                ans[offset+j] = T[j]
            break
    else:
        print('UNRESTORABLE')
        exit()
    print(''.join(ans))

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
Ans = 0
S = []
for j in range(N-1):
    S.append(sum(A[:N-j-1]))

for i in range(N-1):
    Ans += A[N-i-1]*S[i]

print(Ans%((10**9)+7))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
Ans = 0
S = sum(A)

for i in range(N-1):
    S -= A[N-i-1]
    Ans += A[N-i-1]*S

print(Ans%((10**9)+7))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
Ans = 0
for i in range(N-1):
    Ans += A[N-i-1]*sum(A[:N-i-1])

print(Ans%((10**9)+7))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
Ans = 0
S = sum(A)

for i in range(N-1):
    S -= A[N-i-1]
    Ans += A[N-i-1]*S

print(Ans%((10**9)+7))
Buggy python submission (verdict: Runtime Error):
import random
for i in range(365):
    print(randint(1,26))

Fixed submission:
for i in range(365):
  print(5)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
from functools import reduce

def sangcd(i,j,k):
    return reduce(math.gcd, [i,j,k])

K = int(input())
Ans = 0
for i in itertools.product(range(1,K+1), repeat=3):
    Ans += sangcd(i[0],i[1],i[2])

print(Ans)

Fixed submission:
import math
import itertools
from functools import reduce

def sangcd(i,j,k):
    return reduce(math.gcd, [i,j,k])

K = int(input())
Ans = 0
for i in itertools.product(range(1,K+1), repeat=3):
    Ans += sangcd(i[0],i[1],i[2])

print(Ans)
Buggy python submission (verdict: Runtime Error):
import math
N,K = map(int,input().split())
Ans = (math.log(K,N) +1)
print(Ans)

Fixed submission:
import math
N,K = map(int,input().split())
Ans = (int(math.log(N,K)) +1)
print(Ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
P = list(map(int,input().split()))
Q = list()
for i in range(N-K+1):
  Q.append(sum(P[i:i+K])+K)
print(max(Q)/2)

Fixed submission:
N,K = map(int,input().split())
P = list(map(int,input().split()))
Q = list()
for i in range(N-K+1):
  if i == 0:
    Q.append(sum(P[i:i+K]))
  else:
    Q.append(Q[i-1]-P[i-1]+P[i+K-1])
print((max(Q)+K)/2)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
H = list(map(int,input().split()))
if K <= len(H):
  for i in range(K):
    H.pop(H.index(max(H)))
  print(sum(H))
else:
  print(0)

Fixed submission:
N,K = map(int,input().split())
H = list(map(int,input().split()))
newH = sorted(H, reverse=True)
if K <= len(H):
  print(sum(newH[K:len(H)]))
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
if n == m:
  print(Yes)
else:
  print(No)

Fixed submission:
n,m = map(int,input().split())
if n == m:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
if n == m:
  print(AC)
else:
  print(WA)

Fixed submission:
n,m = map(int,input().split())
if n == m:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
moto = list()
for i in range (M):
  moto.append(input())
 
monme = list()
seigo = list()
i = 0
while i < M:
  a = list(moto[i].split())
  monme.append(int(a[0]))
  seigo.append(a[1])
  i += 1
  
monme2 = list()
seigo2 = list()
j = 1
 
while j <= N:
  k = 0
  while k < M:
    if monme[k] == j:
      monme2.append(monme[k])
      seigo2.append(seigo[k])
    k += 1
  j += 1
 
seitou = 0
pena = 0
c = 1
while c <= N:
  d = 0
  karinopena = 0
  while d < M:
    if monme2[d] == c:
      if seigo2[d] == 'WA':
        karinopena += 1
      else:
        seitou += 1
        pena += karinopena
        d = M
    d += 1
  c += 1
print(seitou,pena)

Fixed submission:
print(chr(ord(input())+1))
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
i = 11

if n == 8 or n ==9:
  print(11)
  i = 0
elif n == 2 or n== 3 or n == 5 or n == 7:
  print(n)
  i = 0
elif n <= 7 and n%2 == 0:
  print(n+1)
  i = 0

while i != 0:
  j = 3
  js = int(math.sqrt(i))
  while j <= js:
    if  i%j == 0:
      break
    elif j == js or j == js-1:
      print(i)
      break
      i = 0
    else:
      if j%2 == 0:
        j += 1
      else:
        j += 2
  if i%2 == 0:
    i += 1
  else:
    i += 2

Fixed submission:
x = int(input())
if x <= 3:
  n = x
elif x == 4:
  n = 5
else:
  n = x
  j = 0
  while j == 0:
    a = int(n/2) + 1
    i = 2
    while i < a:
      if i == a-1:
        j = 1
        i = a
      elif n % i != 0:
        i += 1
      else:
        i = a
        n += 1
print(n)

Buggy python submission (verdict: Runtime Error):
import math
n = input()
i = 11

if n == 8 or n ==9:
  print(11)
  i = 0
elif n == 2 or n== 3 or n == 5 or n == 7:
  print(n)
  i = 0
elif n <= 7 and n%2 == 0:
  print(n+1)
  i = 0

while i != 0:
  j = 3
  js = int(math.sqrt(i))
  while j <= js:
    if  i%j == 0:
      break
    elif j == js or j == js-1:
      print(i)
      break
      i = 0
    else:
      if j%2 == 0:
        j += 1
      else:
        j += 2
  if i%2 == 0:
    i += 1
  else:
    i += 2

Fixed submission:
x = int(input())
if x <= 3:
  n = x
elif x == 4:
  n = 5
else:
  n = x
  j = 0
  while j == 0:
    a = int(n/2) + 1
    i = 2
    while i < a:
      if i == a-1:
        j = 1
        i = a
      elif n % i != 0:
        i += 1
      else:
        i = a
        n += 1
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
if x <= 3:
  n = x
elif x == 4:
  n = 5
else:
  n = x
  j = 0
  while j == 0:
    a = int(n/2) + 1
    i = 2
    while i < a:
      if i == a-1:
        j = 1
        i = a
      elif n % i != 0:
        if i == 2:
          i += 1
        else:
          i += 2
      else:
        i = a
        if n % 2 == 0:
          n += 1
        else:
          n += 2
print(n)

Fixed submission:
x = int(input())
if x <= 3:
  n = x
elif x == 4:
  n = 5
else:
  n = x
  j = 0
  while j == 0:
    a = int(n/2) + 1
    i = 2
    while i < a:
      if i == a-1:
        j = 1
        i = a
      elif n % i != 0:
        i += 1
      else:
        i = a
        n += 1
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
n = x
j = 0
while j == 0:
  a = int(n/2) + 1
  i = 2
  while i < a:
    if i == a-1:
      j = 1
      i = a
    elif n % i != 0:
      i += 1
    else:
      i = a
      n += 1
print(n)

Fixed submission:
x = int(input())
if x <= 3:
  n = x
elif x == 4:
  n = 5
else:
  n = x
  j = 0
  while j == 0:
    a = int(n/2) + 1
    i = 2
    while i < a:
      if i == a-1:
        j = 1
        i = a
      elif n % i != 0:
        i += 1
      else:
        i = a
        n += 1
print(n)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())
alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
i = 0
while i < len(s):
  j = 0
  while j < 26:
    if s[i] == alpha[j]:
      s[i] = alpha[i+n]
      break
    else:j += 1
  i += 1

k = 0
while k < len(s) :
  print(s[k],end ="")
  k += 1

Fixed submission:
n = int(input())
s = list(input())
alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
i = 0
while i < len(s):
  j = 0
  while j < 26:
    if s[i] == alpha[j]:
      s[i] = alpha[j+n]
      break
    else:j += 1
  i += 1

k = 0
while k < len(s) :
  print(s[k],end ="")
  k += 1
Buggy python submission (verdict: Runtime Error):
a = map(int,input())
print(a**2)

Fixed submission:
r = int(input())
A = r**2
print(A)
Buggy python submission (verdict: Runtime Error):
inputA,B = input().split()
a = int(A)
b = int(B)
K = (a+b)/2
if K == int(K):
  print(int(K))
else:
  print('IMPOSSIBLE')

Fixed submission:
A,B = input().split()
a = int(A)
b = int(B)
K = (a+b)/2
if K == int(K):
  print(int(K))
else:
  print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
a,b,c,d = int(input())
if a+b > c+d:
  ans = "Left"
elif a+b < c+d:
  ans = "Right"
else:
  ans = "Balanced"

print(ans)

Fixed submission:
a,b,c,d = map(int,input().split())
if a+b > c+d:
  ans = "Left"
elif a+b < c+d:
  ans = "Right"
else:
  ans = "Balanced"

print(ans)
Buggy python submission (verdict: Runtime Error):
n,x,t=map(int,input().split())
m=math.ceil(n/x)*t

Fixed submission:
import math
n,x,t=map(int,input().split())
m=math.ceil(n/x)*t
print(m)
Buggy python submission (verdict: Time Limit Exceeded):
#import numpy as np
n=int(input())+1
yueg=[0]*(n)
for i in range(1,n):
  j=0
  while j < n:
    yueg[j]+=1
    j+=i
  yueg[i]*=i
r=0  
#yueg=np.array(yueg)
#ka=np.array([k for k in range(0,n)])
#r=np.sum(yueg*ka)
print(sum(yueg)-yueg[0])

Fixed submission:
#import numpy as np
def main():
  n=int(input())+1
  yueg=[0]*(n)
  for i in range(1,n):
    j=0
    while j < n:
      yueg[j]+=1
      j+=i
    yueg[i]*=i
  r=0  
#yueg=np.array(yueg)
#ka=np.arange(n)
#r=np.sum(yueg*ka)
  print(sum(yueg)-yueg[0])
main()
Buggy python submission (verdict: Runtime Error):
import numpy as np
k=int(input())
s=input()
ls=len(s)
r1=26**ls
a=np.array([range(k+1,k+ls+1)])
m2= np.prod(a)
a=np.array([range(1,ls+1)])
m3= np.prod(a)
m=m2//m3
#r2=25**ls
r3=26**k
#print(r2)
#print(m2)
print((m*r3)%1000000007)

Fixed submission:
s=input()
if s in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
  print("A")
else:
  print("a")
Buggy python submission (verdict: Runtime Error):
import numpy as np
n=int(input())
a=np.array(list(map(int,input().split())))
a0,a1= np.unique(a,return_counts=True)
suma=np.sum(a)
a2=np.array([0]*100000)
for j in range(a0.size):
  a2[a0[j]]=a1[j]
#print(suma)
#print(a0)
#print(a1)
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  sumb=a2[b]
  a2[b]=0
  a2[c]+=sumb
  sumc=sumb*(c-b)
  suma+=sumc
  print(suma)

Fixed submission:
import numpy as np
n=int(input())
a=np.array(list(map(int,input().split())))
a0,a1= np.unique(a,return_counts=True)
suma=np.sum(a)
a2=np.array([0]*100001)
for j in range(a0.size):
  a2[a0[j]]=a1[j]
#print(suma)
#print(a0)
#print(a1)
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  sumb=a2[b]
  a2[b]=0
  a2[c]+=sumb
  sumc=sumb*(c-b)
  suma+=sumc
  print(suma)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n=int(input())
a=np.array(list(map(int,input().split())))
a0,a1= np.unique(a,return_counts=True)
suma=np.sum(a)
#print(suma)
#print(a0)
#print(a1)
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  sumb=a1[np.where(a0==b)]
  a0=np.where(a0==b,c,a0)
  #sumc=0
  #print(a0)
  #print(a1)
  sumc=np.sum(sumb)
  if sumc ==None :
    sumc=0
  #print(sumc)
  sumc*=(c-b)
  #print(sumc)
  suma+=sumc
  print(suma)

Fixed submission:
import numpy as np
n=int(input())
a=np.array(list(map(int,input().split())))
a0,a1= np.unique(a,return_counts=True)
suma=np.sum(a)
a2=np.array([0]*100001)
for j in range(a0.size):
  a2[a0[j]]=a1[j]
#print(suma)
#print(a0)
#print(a1)
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  sumb=a2[b]
  a2[b]=0
  a2[c]+=sumb
  sumc=sumb*(c-b)
  suma+=sumc
  print(suma)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  a=[c if b==j else j for j in a]
  print(sum(a))

Fixed submission:
import numpy as np
n=int(input())
a=np.array(list(map(int,input().split())))
a0,a1= np.unique(a,return_counts=True)
suma=np.sum(a)
a2=np.array([0]*100001)
for j in range(a0.size):
  a2[a0[j]]=a1[j]
#print(suma)
#print(a0)
#print(a1)
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  sumb=a2[b]
  a2[b]=0
  a2[c]+=sumb
  sumc=sumb*(c-b)
  suma+=sumc
  print(suma)
Buggy python submission (verdict: Runtime Error):
n=input()
a=input().replace(" ","*")
t=eval(a)
if t> 10**18:
  print(-1)
else:
  print(t)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
t=1
if 0 in a:
  print(0)
  exit()

for i in range(n):
  t*=a[i]
  if t> 10**18:
    print(-1)
    exit()
print(t)
Buggy python submission (verdict: Runtime Error):
s=input().replace(" ","*").replace(".","")
t=eval(s)
t=int(t//100)
print(t)

Fixed submission:
a,b=map(int,input().replace(".","").split())
t=(a*b)//100
t=int(t)
print(t)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
if n==1:
  if a==[0,1]:
    print(2)
  elif a==[0,2]:
    print(3)
  else:
    print(-1)
  exit()
subt=[0]*(n)
if a[0] == 0:
  subt[0]=2
elif a[0]== 1:
  subt[0]=1
else:
  print(-1)
  exit()

for i in range(n-1):
  if a[i+1] > subt[i]-1:
    if i<n-1:
      print(-1)
      exit()
    elif a[i+1] > subt[i]:
      print(-1)
      exit()
  else:  
    subt[i+1]=(subt[i]-a[i+1])*2
if a[n]> subt[-1]:
  print(-1)
  exit()
if a[n] > subt[-2]:
  subt[-1]=a[n]
else:
  subt[-1]=a[n]
  for j in range(2,n):
    if (subt[-j]-a[-j])*2 < subt[1-j]:
      print(-1)
      exit()
    if (subt[-j]-a[-j]) <= subt[1-j]:
      pass
    else:
      subt[-j]=subt[1-j]+a[-j]
print(sum(subt)+1)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
if n==1:
  if a==[0,1]:
    print(2)
  elif a==[0,2]:
    print(3)
  else:
    print(-1)
  exit()
if n==0:
  if a==[1]:
    print(1)
  else:
    print(-1)
  exit()



subt=[0]*(n)
if a[0] == 0:
  subt[0]=2
elif a[0]== 1:
  subt[0]=1
else:
  print(-1)
  exit()

for i in range(n-1):
  #subt[i+1]=subt[i]-subt[i]*2
  #print(subt[i])
  if a[i+1] > subt[i]-1:
    if i<n-1:
      print(-1)
      #print(n)
      #print(subt[i])
      exit()
      #pass
    elif a[i+1] > subt[i]:
      print(-1)
      exit()
      #pass
  else:  
    subt[i+1]=(subt[i]-a[i+1])*2
if a[n]> subt[-1]:
  print(-1)
  exit()
if a[n] > subt[-2]:
  subt[-1]=a[n]
else:
  subt[-1]=a[n]
  for j in range(2,n):
    if (subt[-j]-a[-j])*2 < subt[1-j]:
      print(-1)
      exit()
    if (subt[-j]-a[-j]) <= subt[1-j]:
      pass
    else:
      subt[-j]=subt[1-j]+a[-j]
  
    #pass
  
print(sum(subt)+1)
    
#print(subt)
Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
print(min((a-max(k-a-b,0)),k)

Fixed submission:
a,b,c,k=map(int,input().split())
print(min((a-max(k-a-b,0)),k))

Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
printmin((a-max(k-a-b,0)),k)

Fixed submission:
a,b,c,k=map(int,input().split())
print(min((a-max(k-a-b,0)),k))
Buggy python submission (verdict: Runtime Error):
def factorization(num):
  if num == 1:
    return [1]
  factor = []
  while num > 1:
    for i in range(num - 1):
      k = i + 2
      if num % k == 0:
        factor.append(k)
        num = int(num / k)
        break
  return factor
  
x=int(input())
a=0
b=0
a_b=0
y=factorization(x)
len_y=len(y)
z=set(y)


z=list(z)
#print(z)
for j in range(len(z)):
  a_b=z[j]
  for k in range(a_b):
    a=a_b+k
    b=k
    if a**5-b**5== x:
      print("%d %d" % (a,b))
      exit()
    a=a_b-k
    b=0-k
    if a**5-b**5== x:
      print("%d %d" % (a,b))
      exit()
      
if len_y > 2:
  z=set([])
  for l in range(0,len_y-1):
    for m in range(l,len_y):
      z=z|set([y[l]*y[m]])
  z=list(z)
  for j in range(len(z)):
    a_b=z[j]
    for k in range(a_b):
      a=a_b+k
      b=k
      if a**5-b**5== x:
        print("%d %d" % (a,b))
        exit()
      a=a_b-k
      b=0-k
      if a**5-b**5== x:
        print("%d %d" % (a,b))
        exit()
    
if len_y > 3:
  z=set([])
  for l in range(0,len_y-2):
    for m in range(l,len_y-1):
      for n in range(m,len_y):
        z=z|set([y[l]*y[m]*y[n]])
  z=list(z)
  for j in range(len(z)):
    a_b=z[j]
    for k in range(a_b):
      a=a_b+k
      b=k
      if a**5-b**5== x:
        print("%d %d" % (a,b))
        exit()
      a=a_b-k
      b=0-k
      if a**5-b**5== x:
        print("%d %d" % (a,b))
        exit()

if len_y > 4:
  z=set([])
  for l in range(0,len_y-3):
    for m in range(l,len_y-2):
      for n in range(m,len_y-1):
        for p in range(n,len_y):
          z=z|set([y[l]*y[m]*y[p]])
  z=list(z)
  for j in range(len(z)):
    a_b=z[j]
    for k in range(a_b):
      a=a_b+k
      b=k
      if a**5-b**5== x:
        print("%d %d" % (a,b))
        exit()
      a=a_b-k
      b=0-k
      if a**5-b**5== x:
        print("%d %d" % (a,b))
        exit()

if len_y > 5:
  z=set([])
  for l in range(0,len_y-4):
    for m in range(l,len_y-3):
      for n in range(m,len_y-2):
        for p in range(n,len_y-1):
          for q in range(p,len_y):
            z=z|set([y[l]*y[m]*y[p]*y[q]])
  z=list(z)
  for j in range(len(z)):
    a_b=z[j]
    for k in range(a_b):
      a=a_b+k
      b=k
      if a**5-b**5== x:
        print("%d %d" % (a,b))
        exit()
      a=a_b-k
      b=0-k
      if a**5-b**5== x:
        print("%d %d" % (a,b))
        exit()

Fixed submission:
o={"ABC":"ARC","ARC":"ABC"}
s = input()
print(o[s])
Buggy python submission (verdict: Runtime Error):
    i=int(input())
    i1=i*(i+1)/2
    i2=i//3
    i3=i//5
    i4=i2*(i2+1)/2
    i5=i3*(i3+1)/2
    i6=i//15
    i7=i6*(i6+1)/2
    print(i1-i4-i5+i6)

Fixed submission:
i=int(input())
i1=i*(i+1)//2
i2=i//3
i3=i//5
i4=i2*(i2+1)//2
i5=i3*(i3+1)//2
i6=i//15
i7=i6*(i6+1)//2
print(i1-i4*3-i5*5+i7*15)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
k=int(input())
t=0
for i in range(k):
  for j in range(k):
    for l in range(k):
      t+=gcd((i+1),(j+1),(l+1))
print(t)

Fixed submission:
i=int(input())
a=[0, \
1	, \
9	, \
30	, \
76	, \
141	, \
267	, \
400	, \
624	, \
885	, \
1249	, \
1590	, \
2208	, \
2689	, \
3411	, \
4248	, \
5248	, \
6081	, \
7485	, \
8530	, \
10248	, \
11889	, \
13687	, \
15228	, \
17988	, \
20053	, \
22569	, \
25242	, \
28588	, \
31053	, \
35463	, \
38284	, \
42540	, \
46581	, \
50893	, \
55362	, \
61824	, \
65857	, \
71247	, \
76884	, \
84388	, \
89349	, \
97881	, \
103342	, \
111528	, \
120141	, \
128047	, \
134580	, \
146316	, \
154177	, \
164817	, \
174438	, \
185836	, \
194157	, \
207927	, \
218812	, \
233268	, \
245277	, \
257857	, \
268182	, \
288216	, \
299257	, \
313635	, \
330204	, \
347836	, \
362973	, \
383709	, \
397042	, \
416448	, \
434025	, \
456967	, \
471948	, \
499740	, \
515581	, \
536073	, \
559758	, \
583960	, \
604833	, \
633651	, \
652216	, \
683712	, \
709065	, \
734233	, \
754734	, \
793188	, \
818917	, \
846603	, \
874512	, \
909496	, \
933081	, \
977145	, \
1006126	, \
1041504	, \
1073385	, \
1106467	, \
1138536	, \
1187112	, \
1215145	, \
1255101	, \
1295142	, \
1342852	, \
1373253	, \
1422195	, \
1453816	, \
1502376	, \
1553361	, \
1595437	, \
1629570	, \
1691292	, \
1726717	, \
1782111	, \
1827492	, \
1887772	, \
1925853	, \
1986837	, \
2033674	, \
2089776	, \
2145333	, \
2197483	, \
2246640	, \
2332104	, \
2379085	, \
2434833	, \
2490534	, \
2554600	, \
2609625	, \
2693919	, \
2742052	, \
2813988	, \
2875245	, \
2952085	, \
3003306	, \
3096024	, \
3157249	, \
3224511	, \
3306240	, \
3388576	, \
3444609	, \
3533637	, \
3591322	, \
3693924	, \
3767085	, \
3842623	, \
3912324	, \
4027884	, \
4102093	, \
4181949	, \
4270422	, \
4361548	, \
4427853	, \
4548003	, \
4616104	, \
4718640	, \
4812789	, \
4918561	, \
5003286	, \
5131848	, \
5205481	, \
5299011	, \
5392008	, \
5521384	, \
5610705	, \
5739009	, \
5818390	, \
5930196	, \
6052893	, \
6156139	, \
6239472	, \
6402720	, \
6493681	, \
6623853	, \
6741078	, \
6864016	, \
6953457	, \
7094451	, \
7215016	, \
7359936	, \
7475145	, \
7593865	, \
7689630	, \
7886244	, \
7984165	, \
8130747	, \
8253888	, \
8403448	, \
8523897	, \
8684853	, \
8802826	, \
8949612	, \
9105537	, \
9267595	, \
9376656	, \
9574704	, \
9686065	, \
9827097	, \
9997134	, \
10174780	, \
10290813	, \
10493367	, \
10611772	, \
10813692]
print(a[i])
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 	入力
n=int(input())
t=0
x=0
y=0
s="Yes"
for i in range(n):
  t1,x1,y1=map(int,sys.stdin.readline().split())
  if abs(x1-x)+abs(y1-y) > (t1-t):
    s="No"
    break
  if ((x1 + y1) % 2) == (t1 % 2):
    x=x1
    y=y1
    t=t1
  else:
    s="No"
    break
# 出力
print(s)

Fixed submission:
import sys
# -*- coding: utf-8 -*-
# 	入力
n=int(input())
t=0
x=0
y=0
s="Yes"
for i in range(n):
  t1,x1,y1=map(int,sys.stdin.readline().split())
  if abs(x1-x)+abs(y1-y) > (t1-t):
    s="No"
    break
  if ((x1 + y1) % 2) == (t1 % 2):
    x=x1
    y=y1
    t=t1
  else:
    s="No"
    break
# 出力
print(s)
Buggy python submission (verdict: Runtime Error):

num_line=input().rstrip().split(" ")
num=int(num_line[0])
a=int(num_line[1])
b=int(num_line[2])

allcase=pow(2,num,1000000007)-1
#print(allcase)

abunshi=1
for i in range(num-a+1,num+1):
    abunshi*=i
#print(abunshi)

abumbo=1
for i in range(1,a+1):
    abumbo*=i
#print(abumbo)

abumbo=pow(abumbo,1000000005,1000000007)
#print(abumbo)

aminus=abunshi*abumbo%1000000007
#print(aminus)

bbunshi=1
for i in range(num-b+1,num+1):
    bbunshi*=i
#print(bbunshi)

bbumbo=1
for i in range(1,b+1):
    bbumbo*=i
#print(bbumbo)

bbumbo=pow(bbumbo,1000000005,1000000007)
#print(bbumbo)

bminus=bbunshi*bbumbo%1000000007
#print(bminus)

print(allcase-aminus-bminus)


Fixed submission:
time_line = input().rstrip().split(" ")
time_a = int(time_line[0])
time_b = int(time_line[1])

if time_a<10:
    hosei=(10-time_a)*100
    
else:
    hosei=0

kekka=time_b+hosei
print(kekka)