Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
s=[input()[0] for i in range(n)]
m,a,r,c,h=0,0,0,0,0
for i in range(n):
    if s[i]=="M": m+=1
    elif s[i]=="A": a+=1
    elif s[i]=="R": r+=1
    elif s[i]=="C": c+=1
    elif s[i]=="H": h+=1
t=sorted([m,a,r,c,h])
if t[2]==0:
    print(0)
    sys.exit()
if t[1]==0:
    print(t[2]*t[3]*t[4])
    sys.exit()
if t[0]==0:
    t[1],t[2],t[3],t[4]=a,b,c,d
    print(a*b*c+a*b*d+a*c*d+b*c*d)
    sys.exit()
else:
    t[0],t[1],t[2],t[3],t[4]=a,b,c,d,e
    x=a*b*c+a*b*d+a*b*e+a*c*d+a*c*e+a*d*e
    y=b*c*d+b*c*e+b*d*e+c*d*e
    print(x+y)

Fixed submission:
import sys
n=int(input())
s=[input()[0] for i in range(n)]
m,a,r,c,h=0,0,0,0,0
for i in range(n):
    if s[i]=="M": m+=1
    elif s[i]=="A": a+=1
    elif s[i]=="R": r+=1
    elif s[i]=="C": c+=1
    elif s[i]=="H": h+=1
t=sorted([m,a,r,c,h])
q,w,e,r,u=0,0,0,0,0
if t[2]==0:
    print(0)
    sys.exit()
if t[1]==0:
    print(t[2]*t[3]*t[4])
    sys.exit()
if t[0]==0:
    q,w,e,r=t[1],t[2],t[3],t[4]
    print(q*w*e+q*w*r+q*e*r+w*e*r)
    sys.exit()
else:
    q,w,e,r,u=t[0],t[1],t[2],t[3],t[4]
    x=q*w*e+q*w*r+q*w*u+q*e*r+q*e*u+q*r*u
    y=w*e*r+w*e*u+w*r*u+e*r*u
    print(x+y)
Buggy python submission (verdict: Runtime Error):
if n<10:
  print(n)
else:
  L=list(map(int, list(str(n))))
  if(L.count(9)==len(L)) or (L[0]!=9 and L.count(9)==len(L) -1):
    print(sum(L))
  else :
    print(9*(len(L)-1)+int(L[0])-1)



Fixed submission:
n=int(input())
if n<10:
  print(n)
else:
  L=list(map(int, list(str(n))))
  if(L.count(9)==len(L)) or (L[0]!=9 and L.count(9)==len(L) -1):
    print(sum(L))
  else :
    print(9*(len(L)-1)+int(L[0])-1)

Buggy python submission (verdict: Runtime Error):
n=int(input())
if N<10:
  print(n)
else:
  L=list(map(int, list(str(N))))
  if(L.count(9)==len(L)) or (L[0]!=9 and L.count(9)==len(L) -1):
    print(sum(L))
  else :
    print(9*(len(L)-1)+int(L[0])-1)


Fixed submission:
n=int(input())
if n<10:
  print(n)
else:
  L=list(map(int, list(str(n))))
  if(L.count(9)==len(L)) or (L[0]!=9 and L.count(9)==len(L) -1):
    print(sum(L))
  else :
    print(9*(len(L)-1)+int(L[0])-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(map(int,input().split()))
s=sorted(s)
s.reverse()
sum=0
for i in range(n):
    if i%2==0:
        sum+=s[i]
    else:
        sum-=s[i]
print(int(sum))
        





Fixed submission:
n=int(input())
a=int(input())
if n<500:
    if a<n:
        print("No")
    else:
        print("Yes")
else:
    m=n%500
    if a<m:
        print("No")
    else:
        print("Yes")

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[int(input()) for k in range(n)]
s.sort()
s.reverse()
sum=0
for i in range(n):
    if i%2==0:
        sum+=s[i]
    else:
        sum-=s[i]
print(int(sum))
        





Fixed submission:
n=int(input())
a=int(input())
if n<500:
    if a<n:
        print("No")
    else:
        print("Yes")
else:
    m=n%500
    if a<m:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
n=int(input())
aaa=[input().split() for i in range(n)]
s=map(int,aaa)
s.reverse()
sum=0
for i in range(n):
    if i%2==0:
        sum+=s[i]
    else:
        sum-=s[i]
print(int(sum))
        


Fixed submission:
n=int(input())
s=list(map(int,input().split()))
s=sorted(s)
s.reverse()
sum=0
for i in range(n):
    if i%2==0:
        sum+=s[i]
    else:
        sum-=s[i]
print(int(sum))
Buggy python submission (verdict: Runtime Error):
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13:
    print("Yes")
else:
    print("No")


Fixed submission:
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 \
and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 \
and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13) :
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13 :
    print("Yes")
else:
    print("No")

Fixed submission:
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 \
and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 \
and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13) :
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b=map(str,input().split())
n=int(a+b)
if int(n**(1/2)**2==n:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b=map(str,input().split())
n=int(a+b)
if int(n**(1/2))**2==n:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math

a,b = list(map(int, input().split()))

c = a + b
d = c/2

x = ceil(d)

print(x)

Fixed submission:
import math

a,b = list(map(int, input().split()))

c = a + b
d = c/2

x = math.ceil(d)

print(x)
Buggy python submission (verdict: Runtime Error):
import sys
s=input()
t=input()
s=sorted(list(s))
t=sorted(list(t))[::-1]
sum=0
for i in range(len(s)):
    if ord(s[i])<ord(t[i]):
        print("Yes")
        sys.exit()
print("No")


Fixed submission:
s=input()
t=input()
s="".join(sorted(list(s)))
t="".join(sorted(list(t))[::-1])
if s<t:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import sys
s=input()
t=input()
s=sorted(list(s))
t=sorted(list(t))[::-1]
sum=0
for i in range(len(s)):
    if chr(s[i])<chr(s[t]):
        print("Yes")
        sys.exit()
print("No")



Fixed submission:
s=input()
t=input()
s="".join(sorted(list(s)))
t="".join(sorted(list(t))[::-1])
if s<t:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
a_max=max(a)
a_min=min(a)
if a_min>=0:
    adding=a_max
elif a_min<0 and a_max>0:
    if abs(a_max)>=abs(a_min):
        adding=a_max
    else:
        adding=a_min
else:
    adding=a_min
ind=a.index(adding)
proc=[]
for i in range(n):
    ans+=1
    a[i]+=adding
    proc.append([ind+1,i+1])
for i in range(n-1):
    ans+=1
    a[i+1]+=a[i]
    proc.append([i+1,i+2])
print(ans)
for i in range(len(proc)):
    print(proc[i][0],proc[i][1])

Fixed submission:
s = input()
 
print(int(s[0])+int(s[1])+int(s[2]))

Buggy python submission (verdict: Runtime Error):
s = input()
2. 
3.# sを分解して1の数をカウントする
4.print(s.count('1'))


Fixed submission:
s = input()
 
print(int(s[0])+int(s[1])+int(s[2]))

Buggy python submission (verdict: Runtime Error):

1.# -*- coding: utf-8 -*-
2."""
3.Created on Wed Dec 20 11:35:39 2017
4. 
5.@author: kotania
6."""
7. 
8.s = input()
9. 
10.print(int(s[0])+int(s[1])+int(s[2]))



Fixed submission:
s = input()
 
print(int(s[0])+int(s[1])+int(s[2]))

Buggy python submission (verdict: Runtime Error):
ggg


Fixed submission:
s = input()
 
print(int(s[0])+int(s[1])+int(s[2]))
Buggy python submission (verdict: Runtime Error):
N=int(input()) A=int(input()) B=int(input())

v_fee=N*A
f_fee=B

data=[v_fee, f_fee]
dmin=min(data)

print(dmin)

Fixed submission:
N, A, B = list(map(int, input().split()))

v_fee = N*A
f_fee = B
 
data = [v_fee , f_fee]
dmin = min(data)
 
print(dmin)
Buggy python submission (verdict: Runtime Error):
xs=input()
xi=int(xs)
xs=list(xs)
fx=sum(xs)
print("Yes" if xi%fx==0 else "No")

Fixed submission:
N=int(input())
def digitsum(N) :
  s = str(N)
  array = list(map(int, list(s)))
  T = sum(array) 
  return T

U = digitsum(N)

if N % U ==0 :
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N=input()
def digitsum(N) :
  s = str(N)
  array = list(map(int, list(s)))
  T = sum(array) 
  return T

U = digitsum(N)

if N % U ==0 :
  print("Yes")
else:
  print("No")

Fixed submission:
N=int(input())
def digitsum(N) :
  s = str(N)
  array = list(map(int, list(s)))
  T = sum(array) 
  return T

U = digitsum(N)

if N % U ==0 :
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
L=[2,1]
for i in range(n-1):
    Lu=L[-1]+L[-2]
    L.append(Lu)
print(Lu[-1])

Fixed submission:
n=int(input())
L=[2,1]
for i in range(n-1):
    Lu=L[-1]+L[-2]
    L.append(Lu)
print(L[-1])
Buggy python submission (verdict: Runtime Error):
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print(<)
elif x==y:
    print(=)
else:
    print(>)



Fixed submission:
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print("<")
elif x==y:
    print("=")
else:
    print(">")

Buggy python submission (verdict: Runtime Error):
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if int(x)<int(y):
    print(<)
elif x==y:
    print(=)
else:
    print(>)


Fixed submission:
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print("<")
elif x==y:
    print("=")
else:
    print(">")

Buggy python submission (verdict: Runtime Error):
x,y=map(str,input().split())
"A"="1"
"B"="2"
"C"="3"
"D"="4"
"E"="5"
"F"="6"
if int(x)<int(y):
    print(<)
elif x==y:
    print(=)
else:
    print(>)

Fixed submission:
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print("<")
elif x==y:
    print("=")
else:
    print(">")

Buggy python submission (verdict: Runtime Error):
[X,Y]=input().split()
2.if X > Y:
3.    print(">")
4.elif X==Y:
5.    print("=")
6.else:
7.    print("<")


Fixed submission:
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print("<")
elif x==y:
    print("=")
else:
    print(">")

Buggy python submission (verdict: Runtime Error):
if

Fixed submission:
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print("<")
elif x==y:
    print("=")
else:
    print(">")
Buggy python submission (verdict: Runtime Error):
jj

Fixed submission:
x,y,z=map(int,input().split())
i,sum=0,0
while True:
    sum+=y+z
    i+=1
    if sum>x-z:
        print(i-1)
        break
Buggy python submission (verdict: Runtime Error):
asdfghjkl;

Fixed submission:
n,m = map(int,input().split())
print((1900*m+100*(n-m))*2**m)
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
if a==b.reverse():
    print("YES")
else:
    print("NO")

Fixed submission:
a=input()
b=input()
if a==b[::-1]:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
c11,c12,c13=map(str,input().split())
c21,c22,c23=map(str,input().split())
if c11==c23 and c12==c22 and c13==c21:
    print("YES")
else:
    print("NO")


Fixed submission:
a=input()
b=input()
if a==b[::-1]:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
if c11==c23 and c12==c22 and c13==c21:
    print("YES")
else:
    print("NO")

Fixed submission:
a=input()
b=input()
if a==b[::-1]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
n=len(s)-len(t)+1
lst=[]
for i in range(n):
    tot=0
    ss=s
    for j in range(len(t)):
        if ss[i+j]==t[j] or ss[i+j]=="?":
            tot+=1
    if tot==len(t):
        for j in range(len(t)):
            ss[i+j]=t[j]
        ss=ss.replace("?","a")
        lst.append(ss)
lst.sort()
print(lst[0] if len(lst)!=0 else "UNRESTORABLE" )

Fixed submission:
s=input()
t=input()
n=len(s)-len(t)+1
lst=[]
for i in range(n):
    tot=0
    ss=s
    for j in range(len(t)):
        if ss[i+j]==t[j] or ss[i+j]=="?":
            tot+=1
    if tot==len(t):
        ss=list(ss)
        t=list(t)
        for j in range(len(t)):
            ss[i+j]=t[j]
        ss="".join(ss)
        t="".join(t)
        ss=ss.replace("?","a")
        lst.append(ss)
lst.sort()
print(lst[0] if len(lst)!=0 else "UNRESTORABLE" )
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=""
for i in range(w+2):
    a=a+"a"
S=[a]
for i in range(h):
    S.append("a"+input()+"a")
S.append(a)
for i in range(1,h+1):
    for j in range(1,w+1):
        if S[i][j]==".":
            num=0
            for u in range(-1,2):
                for v in range(-1,2):
                    if S[i+u][j+v]=="#":
                        num+=1
            S[i]=S[i][:j-1]+str(num)+S[i][:j+1]
for i in range(1,h+1):
    print(S[i][1:w+1])

Fixed submission:
h,w=map(int,input().split())
a=""
for i in range(w+2):
    a=a+"a"
S=[a]
for i in range(h):
    S.append("a"+input()+"a")
S.append(a)
for i in range(1,h+1):
    for j in range(1,w+1):
        if S[i][j]==".":
            num=0
            for u in range(-1,2):
                for v in range(-1,2):
                    if S[i+u][j+v]=="#":
                        num+=1
            S[i]=S[i][:j]+str(num)+S[i][j+1:]
for i in range(1,h+1):
    print(S[i][1:w+1])
Buggy python submission (verdict: Runtime Error):
n,a=(int(input() for i in range(2))
print(n**2-a)

Fixed submission:
n,a=(int(input()) for i in range(2))
print(n**2-a)
Buggy python submission (verdict: Runtime Error):
s=input()
a=""
for i in range(len(s):
    if i%2==0:
        a=a+s[i]
print(a)

Fixed submission:
s=input()
a=""
for i in range(len(s)):
    if i%2==0:
        a=a+s[i]
print(a)
Buggy python submission (verdict: Runtime Error):
s=sorted(list(set(list(input()))))
if len(s)==26:
    print("None")
alph=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
for i in range(26):
    if s[i]!=alph[i]:
        print(alph[i])

Fixed submission:
S=sorted(list(set(list(input()))))
alph=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sum=0
A="None"
for i in range(len(S)):
    if S[i]!=alph[i]:
        A=alph[i]
        break
if A=="None" and len(S)<26:
    A=alph[i+1]

print(A)
Buggy python submission (verdict: Runtime Error):
n=input()
if n[0]==n[2[]:
    print("Yes")
else:
    print("No")

Fixed submission:
n=input()
if n[0]==n[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=reversed(sorted(list(map(int,input().split()))))
sum=0
for i in range(k):
    sum+=l[i]
print(sum)

Fixed submission:
n,k=map(int,input().split())
l=sorted(list(map(int,input().split())))[::-1]
sum=0
for i in range(k):
    sum+=l[i]
print(sum)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input()split())
if a<=c<=b:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c=map(int,input().split())
if a<=c<=b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
o=input()
e=input()
n=len(e)
a=""
if len(o)-len(e)==0:
    for i in range(n):
        a=a+o[i]+e[i]
    print(a)
else:
    for i in range(n):
        a=a+o[i]+e[i]
    a=a+e[n]
    print(a)


Fixed submission:
o=input()
e=input()
n=len(e)
a=""
if len(o)-len(e)==0:
    for i in range(n):
        a=a+o[i]+e[i]
    print(a)
else:
    for i in range(n):
        a=a+o[i]+e[i]
    a=a+o[n]
    print(a)

Buggy python submission (verdict: Runtime Error):
o=input()
e=input()
n=len(e)
a=""
if len(o)-len(e)==0:
    for i in range(n):
        a=a+o[i]+e[i]
    print(a)
else:
    for i in range(n):
        a=a+0[i]+e[i]
    a=a+e[n]
    print(a)

Fixed submission:
o=input()
e=input()
n=len(e)
a=""
if len(o)-len(e)==0:
    for i in range(n):
        a=a+o[i]+e[i]
    print(a)
else:
    for i in range(n):
        a=a+o[i]+e[i]
    a=a+o[n]
    print(a)
Buggy python submission (verdict: Runtime Error):
w,a,b=map(int,input().split())
if a+w>=b and b+w>=a:
    print(0)
elif: a+w>b:
    print(a-b-w)
else:
    print(b-a-w)

Fixed submission:
w,a,b=map(int,input().split())
if a+w>=b and b+w>=a:
    print(0)
elif a+w>b:
    print(a-b-w)
else:
    print(b-a-w)
Buggy python submission (verdict: Time Limit Exceeded):
s=list(input()+"a")
n=len(s)-1
list=[]
for i in range(n):
    if s[i]=="A":
        for j in range(i+1,n+1):
            if s[j]=="Z" and s[j+1]!="Z":
                list.append(j-i+1)
print(max(list))

Fixed submission:
s=list(input())
n=len(s)
list=[]
for i in range(n):
    if s[i]=="A":
        list.append(i+1)
        break
for i in range(n):
    if s[n-1-i]=="Z":
        list.append(n-i)
        break
print(list[1]-list[0]+1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(max(ab,cd))

Fixed submission:
a,b,c,d=map(int,input().split())
print(max(a*b,c*d))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
x=0
a=[0]
for i in range(n):
    if s[i]=="I":
        x+=1
        a.append(x)
    else:
        x-=1
        a.append(x)
a=list(set(a))
b=a.reverse()
print(b[0])

Fixed submission:
n=int(input())
s=list(input())
x=0
a=[0]
for i in range(n):
    if s[i]=="I":
        x+=1
        a.append(x)
    else:
        x-=1
        a.append(x)
a=sorted(list(set(a)))
print(a[-1])
Buggy python submission (verdict: Runtime Error):
s=input().split()
print(s[0]+" "+s[1]+" "+s[2])


Fixed submission:
s=input().split(",")
print(s[0]+" "+s[1]+" "+s[2])

Buggy python submission (verdict: Runtime Error):
s=input().split()
print(s[0]+" "+s[1]+" "+s[2]+" ")

Fixed submission:
s=input().split(",")
print(s[0]+" "+s[1]+" "+s[2])
Buggy python submission (verdict: Runtime Error):
k,s=map(int,input().split())
u=min(k,s)
sum=0
for i in range(u+1):
    sum+=min(s-i,2k)+1
print(sum)


Fixed submission:
k,s=map(int,input().split())
u=min(k,s)
sum=0
if s-2*k>=0:
    for i in range(s-2*k,u+1):
        if s-i<2*k:
            sum+=2*k-s+i+1
        else:
            sum+=1
    print(sum)
elif s-k>=0:
    for i in range(u+1):
        if s-i<k:
            sum+=s-i+1
        else:
            sum+=2*k-s+i+1
    print(sum)
else:
    for i in range(u+1):
        if s-i<2*k:
            sum+=s-i+1
        else:
            sum+=1
    print(sum)
Buggy python submission (verdict: Runtime Error):
a,o,b=map(int,input().split())
if str(o)=="+":
    print(a+b)
else:
    print(a-b)

Fixed submission:
a,o,b=map(str,input().split())
a=int(a)
b=int(b)
if o=="+":
    print(a+b)
else:
    print(a-b)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
sum=0
for i in range(a,b+1):
    if i%x==0:
        sum+=1
print(sum)

Fixed submission:
a,b,x=map(int,input().split())
print(b//x-a//x+1 if a%x==0 else b//x-a//x)
Buggy python submission (verdict: Runtime Error):
from math import ceil
from decimal import *
n=int(input())
prea=1.0
pret=1.0
for i in range(n):
    
    t,a=map(Decimal,input().split())
    i=max(ceil(prea/a),ceil(pret/t))
    pret,prea=t*i,a*i

print(pret+prea)

Fixed submission:
from math import ceil
from decimal import *
n=int(input())
prea=Decimal("1.0")
pret=Decimal("1.0")
for i in range(n):
    
    t,a=map(Decimal,input().split())
    i=max(ceil(prea/a),ceil(pret/t))
    pret,prea=t*i,a*i

print(pret+prea)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=0
prea=0
pret=0
for i in range(n):
    
    i=0
    t,a=map(int,input().split())
    while 1:
        
        i+=1
        if ans<=(a+t)*i and a*i>=prea and t*i>=pret:
            ans=(a+t)*i
            prea,pret=a*i,t*i
            break
print(ans)

Fixed submission:
from math import ceil
from decimal import *
n=int(input())
prea=Decimal("1.0")
pret=Decimal("1.0")
for i in range(n):
    
    t,a=map(Decimal,input().split())
    i=max(ceil(prea/a),ceil(pret/t))
    pret,prea=t*i,a*i

print(pret+prea)
Buggy python submission (verdict: Runtime Error):
s=list(map(int,list(input())))
n=len(s)
ans=0
for i in range(1<<(n-1)):
"""ここで既に、n-1個の文字間のうち、どこに+を入れるかが決まる。入れるところにはbitが立ち(その桁が1となる)、入れないところにはbitが立たない(その桁が0となる)"""
    S=s[0]
    for j in range(n-1):
        if i & (1<<j): #bitが立っている時
            S+="+"+s[j+1]
        else: #bitが立っていない時
            S+=s[j+1]
    ans+=eval(S)
print(ans)

Fixed submission:
s=list(input())
n=len(s)
ans=0
for i in range(1<<(n-1)):

    """
    ここで既に、n-1個の文字間のうち、どこに+を入れるかが決まる。入れるところにはbit
    が立ち(その桁が1となる)、入れないところにはbitが立たない(その桁が0となる)
    """

    S=s[0]
    for j in range(n-1):
        if i & (1<<j): #bitが立っている時
            S+="+"+s[j+1]
        else: #bitが立っていない時
            S+=s[j+1]
    ans+=eval(S)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
list1=[a,b,c]
list2=sorted(list1)
if list2[0]==list2[1]==5 and list2[2]==7:
    print("YES")
else:
    print(NO")

Fixed submission:
a,b,c=map(int,input().split())
list1=[a,b,c]
list2=sorted(list1)
if list2[0]==list2[1]==5 and list2[2]==7:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
x,y,z = map(int,input())
if(x+y+z>=22):
    print("bust")
else:
  print("win")

Fixed submission:
x,y,z = map(int,input().split())
if(x+y+z>=22):
    print("bust")
else:
  print("win")
Buggy python submission (verdict: Runtime Error):
N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Fixed submission:
N = int(input())
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Buggy python submission (verdict: Runtime Error):
N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Fixed submission:
N = int(input())
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Buggy python submission (verdict: Runtime Error):
N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(t)

Fixed submission:
N = int(input())
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Buggy python submission (verdict: Runtime Error):
N = input()
S = input()
t = []
for i in S:
    t.append(chr(ord(i) + N))
print(t.join)

Fixed submission:
N = int(input())
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if(N % 2 == 1):
    print("No")
nn = N / 2
if(S[nn:] == S[:nn]):
    print("Yes")
else:
    print('No')


Fixed submission:
N = int(input())
S = input()
 
if(N % 2 == 1):
    print("No")
    exit()
nn = int(N / 2)
if(S[nn:] != S[:nn]):
    print('No')
else:
    print("Yes")