Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
r_list=[]
g_list=[]
b_list=[]
for i in range(len(s)):
    if s[i]=="R":
        r_list.append(i)
    elif s[i]=="G":
        g_list.append(i)
    elif s[i]=="B":
        b_list.append(i)

count=0
for i in range(len(r_list)):
    for j in range(len(g_list)):
        for k in range(len(b_list)):
            mx=max(r_list[i],g_list[j],b_list[k])
            mn=min([r_list[i],g_list[j],b_list[k]])
            middle=r_list[i]+g_list[j]+b_list[k]-mx-mn
            if middle-mn != mx-middle:
                count+=1

print(count)

Fixed submission:
n=int(input())
s=input()
count=0
r_list=[]
g_list=[]
b_list=[]
for i in range(len(s)):
    if s[i]=="R":
        r_list.append(i)
    elif s[i]=="G":
        g_list.append(i)
    elif s[i]=="B":
        b_list.append(i)

for i in range(1,len(s)-1):
    if n%2==0:
        if i<n//2:
            for j in range(1,i+1):
                if s[i]!=s[i-j] and s[i]!=s[i+j] and s[i+j]!=s[i-j]:
                    count+=1
        else:
            for j in range(1,n-i):
                if s[i]!=s[i-j] and s[i]!=s[i+j] and s[i+j]!=s[i-j]:
                    count+=1
    else:
            if i<(n-1)//2:
                for j in range(1,i+1):
                    if s[i]!=s[i-j] and s[i]!=s[i+j] and s[i+j]!=s[i-j]:
                        count+=1
            elif i==(n-1)//2:
                for j in range(1,n-i):
                    if s[i]!=s[i-j] and s[i]!=s[i+j] and s[i+j]!=s[i-j]:
                        count+=1
            elif i>(n-1)//2:
                for j in range(1,n-i):
                    if s[i]!=s[i-j] and s[i]!=s[i+j] and s[i+j]!=s[i-j]:
                        count+=1

print(len(r_list)*len(g_list)*len(b_list)-count)
Buggy python submission (verdict: Runtime Error):
import math
def comb(n, r):
    if(n>=r):
        return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))
    else:
        return 0

f = open("input.txt", "r")
sys.stdin = f

m,n = map(int, input().split())
ans = comb(m, 2) + comb(n, 2)
print(ans)

Fixed submission:
import math
def comb(n, r):
    if(n>=r):
        return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))
    else:
        return 0
        
m,n = map(int, input().split())
ans = comb(m, 2) + comb(n, 2)
print(ans)
Buggy python submission (verdict: Runtime Error):
H,N = list(map(int,input().split))
A = list(map(int,input().split))
s = A[0]
for i in range(1,len(A)):
    s += A[i]
if s>=H:
    print("Yes")
else:
    print("No")

Fixed submission:
H,N = list(map(int,input().split()))
A = list(map(int,input().split()))
s = A[0]
for i in range(1,len(A)):
    s += A[i]
if s>=H:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
today = input()
if today == Sunny:
  tomorrow = Cloudy
elif today == Cloudy:
  tomorrow = Rainy
else:
  tomorrow = Sunny
print(tomorrow)

Fixed submission:
today = input()
if today == 'Sunny':
  tomorrow = 'Cloudy'
elif today == 'Cloudy':
  tomorrow = 'Rainy'
else:
  tomorrow = 'Sunny'
print(tomorrow)
Buggy python submission (verdict: Runtime Error):
n, y =  map(int, input().split())
 
res_a, res_b, res_c = -1
 
for i in range(n):
  for j in range(n):
      if 10000*i + 5000*j + 1000*(n-i-j) == y:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

Fixed submission:
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n+1):
  for j in range(n+1):
      if 10000*i + 5000*j + 1000*(n-i-j) == y and i+j <= n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

Buggy python submission (verdict: Runtime Error):
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n):
  for j in range(n):
      if 10000*i + 5000*j + 1000*k == y and i+j+k == n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

Fixed submission:
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n+1):
  for j in range(n+1):
      if 10000*i + 5000*j + 1000*(n-i-j) == y and i+j <= n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

Buggy python submission (verdict: Runtime Error):
ソースコード 

Copy
Copy
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n):
  for j in range(n):
      if 10000*i + 5000*j + 1000*k == y and i+j+k == n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

Fixed submission:
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n+1):
  for j in range(n+1):
      if 10000*i + 5000*j + 1000*(n-i-j) == y and i+j <= n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)
Buggy python submission (verdict: Runtime Error):
s = input()
s = s[::-1]
t_list = ['dream', 'dreamer', 'erase', 'eraser']
t_list = [i[::-1] for i in t_list]
i = 0

while i < len(s):
    can = False
    for j in range(4):
        if s[i:i+len(t_list[j])] == t_list[j]:
            i+=len(t_list[j])
            can = True
    if can == False: # うまくいっても最後には`can=False`になる
        break

if can == True
    print('YES')
else:
    print('NO')

Fixed submission:
s = input()
s = s[::-1]
t_list = ['dream','dreamer','erase','eraser']
t_list = [t[::-1] for t in t_list]
 
ans = 'NO'
i = 0
while i < len(s):  
  p = i
  for t in t_list:        
    if s[i:i+len(t)] == t:      
      i += len(t)
      if i == len(s):
        ans ='YES'
      break
  if p==i or ans=='YES':
    break
 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

S = list(input())
a=[int(x) for x in S] #int型のリストに変換
a.reverse()
#print(a)
l=[0]*2019
l[0]=1
T=0
d=1

for i in a:
    T+=(int(i)*d)
    T%=2019
    l[T]+=1
    d*=10
result=0
for n in l:
    result+=n*(n-1)/2
print(int(result))


Fixed submission:
S = list(input())
a=[int(x) for x in S] #int型のリストに変換
a.reverse()
#print(a)
l=[0]*2019
l[0]=1
T=0
d=1

for i in a:
    T+=(int(i)*d)
    T%=2019
    l[T]+=1
    d*=10
    d%=2019
result=0
for n in l:
    result+=n*(n-1)/2
print(int(result))

Buggy python submission (verdict: Time Limit Exceeded):
import collections

S = list(input())
a=[int(x) for x in S] #int型のリストに変換
a.reverse()
#print(a)

n=len(a)
T=[0]*n
L=[0]*n

T[0]=a[0]
L[0]=a[0]
for i in range(1,n):
    T[i]=T[i-1]+(a[i]*10**i)
    L[i]=T[i]%2019

#print(T)


#print(L)
c = collections.Counter(L)

#出現回数が2回以上のものの出現数 + 0の出現回数
print(int(len([i[0] for i in c.items() if i[1] >= 2])) + int(len([i for i in L if i==0])))

Fixed submission:
S = list(input())
a=[int(x) for x in S] #int型のリストに変換
a.reverse()
#print(a)
l=[0]*2019
l[0]=1
T=0
d=1

for i in a:
    T+=(int(i)*d)
    T%=2019
    l[T]+=1
    d*=10
    d%=2019
result=0
for n in l:
    result+=n*(n-1)/2
print(int(result))

Buggy python submission (verdict: Time Limit Exceeded):
import collections

S = list(input())
a=[int(x) for x in S] #int型のリストに変換
a.reverse()
#print(a)

n=len(a)
T=[0]*n

T[0]=a[0]

for i in range(1,n):
    T[i]=T[i-1]+(a[i]*10**i)

#print(T)
L=list()
for i in range(n):
    L.append(T[i]%2019)
   

#print(L)
c = collections.Counter(L)

#出現回数が2回以上のものの出現数 + 0の出現回数
print(int(len([i[0] for i in c.items() if i[1] >= 2])) + int(len([i for i in L if i==0])))

Fixed submission:
S = list(input())
a=[int(x) for x in S] #int型のリストに変換
a.reverse()
#print(a)
l=[0]*2019
l[0]=1
T=0
d=1

for i in a:
    T+=(int(i)*d)
    T%=2019
    l[T]+=1
    d*=10
    d%=2019
result=0
for n in l:
    result+=n*(n-1)/2
print(int(result))

Buggy python submission (verdict: Time Limit Exceeded):
import collections

S = list(input())
a=[int(x) for x in S] #int型のリストに変換
#print(a)

n=len(a)-1
T=list()

for i in range(n+1):
    T.append(a[n-i]*10**i)
    
#print(T)
for i in range(1,n+1):
    T[i]+=T[i-1]
    
#print(T)
L=list()
for i in range(n+1):
    L.append(T[i]%2019)
   

#print(L)
c = collections.Counter(L)

#出現回数が2回以上のものの出現数 + 0の出現回数
print(int(len([i[0] for i in c.items() if i[1] >= 2])) + int(len([i for i in L if i==0])))

Fixed submission:
S = list(input())
a=[int(x) for x in S] #int型のリストに変換
a.reverse()
#print(a)
l=[0]*2019
l[0]=1
T=0
d=1

for i in a:
    T+=(int(i)*d)
    T%=2019
    l[T]+=1
    d*=10
    d%=2019
result=0
for n in l:
    result+=n*(n-1)/2
print(int(result))
Buggy python submission (verdict: Time Limit Exceeded):
N,K=(int(x) for x in input().split())
x=N
if K!=1:
     while True:
        x = abs(x-K)
        y=abs(x-K)
        if y>x:
            break
     print(x)
else:
    print(0)

Fixed submission:
N,K=(int(x) for x in input().split())
x=N%K
if K!=1:
     while True:
        x = abs(x-K)
        y = abs(x-K)
        if y>x:
            break
     print(x)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-2 1
import math
    
N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2:
    print(int(((math.factorial(k))/2- N * M)))

Fixed submission:
N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2: 
    int((N + M) * (N + M - 1) / 2 - (N * M))
    print(int(k * (k - 1) / 2 - (N * M)))

Buggy python submission (verdict: Runtime Error):
import math
    
N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2:
    print(int(((math.factorial(k))/2- N * M)))

Fixed submission:
N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2: 
    int((N + M) * (N + M - 1) / 2 - (N * M))
    print(int(k * (k - 1) / 2 - (N * M)))
Buggy python submission (verdict: Time Limit Exceeded):
input()

a=list(map(int, input().split())) #スペース区切りの数字をlistで取得

if int(len([i for i in a if a.count(i) >= 2])) !=0:
    print("NO")
else :
    print("YES")

Fixed submission:
input()

a=list(map(int, input().split())) #スペース区切りの数字をlistで取得

A=set(a)
if len(A)!=len(a):
    print("NO")
else :
    print("YES")
Buggy python submission (verdict: Runtime Error):
n = int(input())
multi = list(map(int,input().split()))
result = 1 

for i in range(n):
    result = result * multi[i]
    if (result > 10**18):
        ans = -1
        exit()
        
print(result)

Fixed submission:
a, b = map(int,input().split())
print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
multi = list(map(int,input().split()))

result = 1 
for i in multi:
    result = result * i
    
if (result > 10**18):
    print(-1)
else:
    print(result)

Fixed submission:
n = int(input())
multi = list(map(int,input().split()))
result = 1 

if 0 in multi:
    result = 0
    print(0)
    exit()

for i in range(n):
    result = result * multi[i]
    if (result > 10**18):
        result = -1
        break 
        
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
multi = list(map(int,input().split()))

result = 1 
for i in multi:
    result = result * i

if (result > 10**18):
    print(-1)
else:
    print(result)

Fixed submission:
n = int(input())
multi = list(map(int,input().split()))
result = 1 

if 0 in multi:
    result = 0
    print(0)
    exit()

for i in range(n):
    result = result * multi[i]
    if (result > 10**18):
        result = -1
        break 
        
print(result)
Buggy python submission (verdict: Runtime Error):
s = input().trim()
t = input().trim()

if s in t and s < t and len(s) <= 10:
    print("Yes")
else:
    print("No")

Fixed submission:
s = input()
t = input()

if(s == t[:-1]):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

if s in t and len(s) = len(t) +1:
    print("Yes")
else:
    print("No")

Fixed submission:
s = input()
t = input()

if(s == t[:-1]):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

if s in t and t = s + 1:
    print("Yes")
else:
    print("No")


Fixed submission:
s = input()
t = input()

if(s == t[:-1]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int,input().split())

while(A or C != 0):
    C = C - B
    if(C <= 0):
        print("Yes")
        break
    A = A - D
    if(A <= 0):
        print("No")
        break

Fixed submission:
s, w = map(int,input().split())

if(s <= w):
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, D = map(int,input().split())

while(A or C != 0):
    C = C - B
    if(C == 0):
        print("Yes")
        break
    A = A - D
    if(A == 0):
        print("No")
        break

Fixed submission:
A, B, C, D = map(int,input().split())

while(A or C <= 0):
    C = C - B
    if(C <= 0):
        print("Yes")
        break
    A = A - D
    if(A <= 0):
        print("No")
        break
Buggy python submission (verdict: Runtime Error):
a, op, b = input().split()
if(op == "+"):
    print(int(a)+int(b))
else:
    print(int(a)-int(b))　

Fixed submission:
a, op, b = input().split()
if(op == "+"):
    print(int(a)+int(b))
else:
    print(int(a)-int(b))
Buggy python submission (verdict: Runtime Error):
a=input()
b=int(a[-1])

if b=0or b=1 or b=6 or b=8:
    print("pon")

elif b=3:
    print("bon")
else:
    print("hon")

Fixed submission:
#a,b,c=map(int,input().split())
a=input()
b=int(a[-1])

if b==0 or b==1 or b==6 or b==8:
    print("pon")

elif b==3:
    print("bon")
else:
    print("hon")
Buggy python submission (verdict: Runtime Error):
#import numpy as np
#a,b,c=map(int,input().split())
z=int(input())
a=input()
if len(a)>z:
    b=a[:z]
    print(b+"...")
else:
    print(b)


Fixed submission:
#import numpy as np
#a,b,c=map(int,input().split())
z=int(input())
a=input()
if len(a)>z:
    b=a[:z]
    print(b+"...")
else:
    print(a)
Buggy python submission (verdict: Runtime Error):
a=input()
if a~="ARC":
  print("ABC")
 
if a~="ABC":
  print("ARC")

Fixed submission:
a=input()
if a=="ARC":
  print("ABC")
 
if a=="ABC":
  print("ARC")
Buggy python submission (verdict: Runtime Error):
mport math

b=int(input())

print(math.pi*b*2)


Fixed submission:
import math

b=int(input())

print(math.pi*b*2)
Buggy python submission (verdict: Runtime Error):

a=int(input())
b=str(input())
sum=0
c=b
d=b
i=0
for s in b:
    for n in range(i,a):
        if c[n]!=c[i]:
            j=n-i
            if a>=n:
                for m in range(n,a):
                    if c[m]!=c[i] and c[m]!=c[n]:
                        k=m-n
                        if k!=j:
                            sum+=1



    i+=1
print(sum)

Fixed submission:
a=str(input())
if "7"in a:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import re
a=int(input())
b=str(input())
sum=0
c=b
d=b
i=0
for s in b:
    for n in range(i,a):
        if c[n]!=c[i]:
            j=n-i
            if a>=n:
                for m in range(n,a):
                    if c[m]!=c[i] and c[m]!=c[n]:
                        k=m-n
                        if k!=j:
                            sum+=1



    i+=1
print(sum)

Fixed submission:
a=str(input())
if "7"in a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
x,y,z=map(int,input().split(" "))
if (x-y-z)**2-4xy>0:
	print("Yes")
else:
 
	print("No")

Fixed submission:
import math
x,y,z=map(int,input().split(" "))

if (z-y-x)**2>4*x*y and z>y and z>x:
	print("Yes")
else:
 
	print("No")

Buggy python submission (verdict: Runtime Error):
x,y,z=map(int,input().split(" "))
if z**2-y**2-x**2>2x*y:
	print("Yes")
else:
 
	print("No")

Fixed submission:
import math
x,y,z=map(int,input().split(" "))

if (z-y-x)**2>4*x*y and z>y and z>x:
	print("Yes")
else:
 
	print("No")

Buggy python submission (verdict: Runtime Error):
x,y,z=map(int,input().split(" "))
if z-y-x>2(pow(x, 0.5)+pow(y, 0.5)):
	print("Yes")
else:
 
	print("No")

Fixed submission:
import math
x,y,z=map(int,input().split(" "))

if (z-y-x)**2>4*x*y and z>y and z>x:
	print("Yes")
else:
 
	print("No")

Buggy python submission (verdict: Runtime Error):
x,y,z=map(int,input().split(" "))
if z-y-y>2(pow(x, 0.5)+pow(y, 0.5)):
	print("Yes")
else:
 
	print("No")

Fixed submission:
import math
x,y,z=map(int,input().split(" "))

if (z-y-x)**2>4*x*y and z>y and z>x:
	print("Yes")
else:
 
	print("No")

Buggy python submission (verdict: Runtime Error):
x,y,z=map(int,input(" "))
if pow(z, 0.5)>pow(x, 0.5)+pow(y, 0.5):
	print("Yes")
else:

	print("No")

Fixed submission:
import math
x,y,z=map(int,input().split(" "))

if (z-y-x)**2>4*x*y and z>y and z>x:
	print("Yes")
else:
 
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):
abm=(input().split(" "))
al1=(input().split(" "))
bl1=(input().split(" "))
minp=int(al1[0])+int(bl1[0])

for ai in al1:
    ai=int(ai)
    for bi in bl1:
        bi=int(bi)
        ci=ai+bi
        if minp>ci:
            minp=ci
for n in range(0,int(abm[2])):
    a,b,c = map(int,input().split())
    ci=int(al1[a-1])+int(bl1[b-1])-int(c)
    if minp>ci:
        minp=ci

print(minp)

Fixed submission:
abm=(input().split(" "))
al1=list(map(int,input().split(" ")))
bl1=list(map(int,input().split(" ")))
#print(al1)
#print(bl1)
minp=min(al1)+min(bl1)


for n in range(0,int(abm[2])):
    a,b,c = map(int,input().split())
    ci=int(al1[a-1])+int(bl1[b-1])-int(c)
    if minp>ci:
        minp=ci

print(minp)
Buggy python submission (verdict: Runtime Error):
import math
l1=input().split(" ")
t80=int(l1[0])
t100=int(l1[1])
t80_min=(t80//0.08)
t80_max=((t80+1)//0.08)
t100_min=(t100//0.1)
t100_max=((t100+1)//0.1)
f=0
for i  in range(min(t80_min,t100_min),max(t100_max,t100_max)):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        sys.exit()
print(-1)

Fixed submission:
import sys
 
a,b = map(int,input().split())
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    sys.exit()
print(-1)

Buggy python submission (verdict: Runtime Error):
import math
l1=input().split(" ")
t80=int(l1[0])
t100=int(l1[1])
t80_min=math.ceil(t80/0.08)
t80_max=math.ceil((t80+1)/0.08)
t100_min=math.ceil(t100/0.1)
t100_max=math.ceil((t100+1)/0.1)
f=0
for i  in range(min(t80_min,t100_min),max(t100_max,t100_max)):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        sys.exit()
print(-1)

Fixed submission:
import sys
 
a,b = map(int,input().split())
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    sys.exit()
print(-1)

Buggy python submission (verdict: Runtime Error):
import math
l1=input().split(" ")
t80=int(l1[0])
t100=int(l1[1])
t80_min=math.ceil(t80/0.08)
t80_max=math.ceil((t80+1)/0.08)
t100_min=math.ceil(t100/0.1)
t100_max=math.ceil((t100+1)/0.1)
f=0
for i  in range(min(t80_min,t100_min),max(t80_max,t100_max)):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        sys.exit()
print(-1)

Fixed submission:
import sys
 
a,b = map(int,input().split())
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    sys.exit()
print(-1)

Buggy python submission (verdict: Runtime Error):
l1=input().split(" ")
t80=int(l1[0])
t100=int(l1[1])
t80_min=(t80/0.08)
t80_max=((t80+1)/0.08)
t100_min=(t100/0.1)
t100_max=((t100+1)/0.1)
if t80_max<t100_min:
    print("-1")
else:
    if t80_min<=t100_min:
        print(math.ceil(t100_min))
    else:
        print(math.ceil(t80_min))


Fixed submission:
import sys
 
a,b = map(int,input().split())
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    sys.exit()
print(-1)
Buggy python submission (verdict: Runtime Error):
for n in range(0,20):
    if n*a-n>=b-1:
        break

print(n)

Fixed submission:
a,b=map(int,input().split())

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b==1:
    n=1
else:
    for n in range(1,20):
    if n*a-n>b:
        break
print(n)

Fixed submission:
a,b=map(int,input().split())

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)

Buggy python submission (verdict: Runtime Error):

a,b=map(int,input().split())
if b==1:
    n=1
else:
    for n in range(0,20):
    if n*a-n>b:
        break
print(n)

Fixed submission:
a,b=map(int,input().split())

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)

Buggy python submission (verdict: Runtime Error):
a=str(input())
b=str(input())
for n in range(0,len(a)):
    if 3*n+1>b:
        break
print(n)


Fixed submission:
a,b=map(int,input().split())

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)

Buggy python submission (verdict: Runtime Error):
a=input().split()

c=a[1]%a[0]
d=b[1]//a[0]
d=d-1
if c!=0:
    d+=1

print(d)

Fixed submission:
a,b=map(int,input().split())

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=b%a
d=b//a
d=d-1
if c!=0:
    d+=1

print(d)

Fixed submission:
a,b=map(int,input().split())

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=b%a
d=b//a
if c!=0:
    d+=1

print(d)

Fixed submission:
a,b=map(int,input().split())

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)
Buggy python submission (verdict: Runtime Error):
a, b, c, d, e = map(int, input().split())
if a == 0:
    print(1)
elif b == 0:
    print(2)
elif c == 0:
    print(3)
elif e == 0:
    print(4)
elif f == 0:
    print(5)


Fixed submission:
a, b, c, d, e = map(int, input().split())
if a == 0:
    print(1)
elif b == 0:
    print(2)
elif c == 0:
    print(3)
elif d == 0:
    print(4)
elif e == 0:
    print(5)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
if S = T[:-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
S = input()
T = input()
if S == T[:-1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
while True:
    C = C - B
    if C <= 0:
        print('Yes')
        break
    A = A - D
    if A <= 0:
        print('No')
        break

Fixed submission:
A, B, C, D = map(int, input().split())
while True:
    C = C - B
    if C <= 0:
        print('Yes')
        exit()
    A = A - D
    if A <= 0:
        print('No')
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 1
for v in A:
    ans = ans * v
if ans > 10 ** 18:
        ans = -1    
print(ans)       

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = 1
if 0 in A:
    ans = 0
else:
    for v in A:
        ans = ans * v
        if ans > 10 ** 18:
            ans = -1
            break;
print(ans)