Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N-int(input())
A=list(map(int,input().split()))
a=0
for i in range(N-1):
    a+=1/A[i]
print(1/a)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=0
for i in range(N):
    a+=1/A[i]
print(1/a)
Buggy python submission (verdict: Time Limit Exceeded):
L,R=map(int,input().split())
ans=2020
for i in range(L,R+1):
    for j in range(i+1,R+1):
        a=(i*j)%2019
        ans=min(ans,a)
print(ans)

Fixed submission:
L,R=map(int,input().split())
ans=2020
if R-L>=2019:
    ans=0
else:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            a=(i*j)%2019
            ans=min(ans,a)
print(ans)
Buggy python submission (verdict: Runtime Error):
    a, b= [int(x) for x in input().split()]
    print(max(a+b, max(a+a-1, b+b-1)))

Fixed submission:
a,b=map(int, input().split())
ans=0
if(a>b):
    ans+=a
    a=a-1
    if(a>b):
        ans+=a
    else:
        ans+=b
else:
    ans+=b
    b=b-1
    if(a>b):
        ans+=a
    else:
        ans+=b
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=list(map(int, input().split()))
ans=0
if H[1]>=H[0]:
    ans+=1
for i in range(N-2):
    if H[i+2]>=H[i+1] and H[i+2]>=H[0]:
        ans+=1
print(ans+1)

Fixed submission:
N=int(input())
H=list(map(int, input().split()))
ans=1
m=H[0]
for i in range(1,N):
    if H[i]>=m:
        ans+=1
        m=H[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,k=map(float, input().split())
c=[]
for i in range(1,a+1):
    if a%i==0 and b%i==0:
        c.append(i)
print(c[k-1])

Fixed submission:
a,b,k=map(int, input().split())
c=[]
for i in range(1,min(a,b)+1):
    if (a%i==0) and (b%i==0):
        c.append(i)
print(c[len(c)-k])
Buggy python submission (verdict: Time Limit Exceeded):
N,Y=map(int,input().split())
ans=-1,-1,-1
for i in range(N+1):
    for j in range(N+1):
        for k in range(N+1):
            if i+j+k==N and 10000*i+5000*j+1000*k==Y:
                ans=i,j,k
print(*ans)

Fixed submission:
N,Y=map(int,input().split())
ans=-1,-1,-1
for i in range(N+1):
    for j in range(N+1-i):
            if 1<=N<=2000 and 10000*i+5000*j+1000*(N-i-j)==Y:
                ans=i,j,N-i-j
print(*ans)
Buggy python submission (verdict: Runtime Error):
    s = input().split()
     
    if s.count('5') == 2 and s.count('7') == 1:
      print('YES')
    else:
      print('NO')

Fixed submission:
N=int(input())
A=int(input())
print(N**2-A)
Buggy python submission (verdict: Runtime Error):
print("Impossible" if int(input()[::2])%3 else "Possible")

Fixed submission:
A,B=map(int,input().split())
print("Impossible" if (A+B)%3!=0 and A%3!=0 and B%3!=0 else "Possible")
Buggy python submission (verdict: Runtime Error):
def func(X):
    if X==1:
        return 1
    else:
        return X*func(X-1)
N=int(input())
print(func(N)%((10**9)+7))

Fixed submission:
import math
print(math.factorial(int(input()))%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
ans=0
for i in range(a+1):
  for j in range(a+1):
    for k in range(a+1):
      if i+j+k==b:
        ans+=1
print(ans)

Fixed submission:
a,b=map(int,input().split())
ans=0
for i in range(a+1):
  for j in range(a+1):
      if 0<=b-i-j<=a:
        ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
ans=0:
for i in range(a+1):
  for j in range(a+1):
    for k in range(a+1):
      if i+j+k==b:
        ans++
print(ans)
        

Fixed submission:
a,b=map(int,input().split())
ans=0
for i in range(a+1):
  for j in range(a+1):
      if 0<=b-i-j<=a:
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[]
for i in range(N):
    s=input()
    S.append(s)
print(sorted(S)[0]+sorted(S)[1]+sorted(S)[2])

Fixed submission:
N,L=map(int,input().split())
A=[]
for i in range(N):
    s=input()
    A.append(s)
B=sorted(A)
for i in range(N):
    print(B[i],end="")
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    if b > a:
        gcd(b, a)
    while b:
	    a, b = b, a % b
    return a

n,m = map(int, input().split())
s = input()
t = input()

l = n * m // gcd(n, m)
a = l // n
b = l // m
#print(a, b)
#a(i-1) = b(j-i) -> ai = bj + (a-b)
res = False
clear_all = True
for i in range(1,n+1):
    if (a*i - (a-b)) % b != 0:
        j = a * i - (a-b)
        if not s[i-1] == t[j-1]:
            clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)
        

Fixed submission:
def gcd(a, b):
    if b > a:
        gcd(b, a)
    while b:
	    a, b = b, a % b
    return a

n,m = map(int, input().split())
s = input()
t = input()

l = n * m // gcd(n, m)
a = l // n
b = l // m
#print(a, b)
#a(i-1) = b(j-i) -> ai = bj + (a-b)
res = False
clear_all = True
for i in range(1,n+1):
    if (a*i - (a-b)) % b == 0:
        j = (a * i - (a-b)) // b
        if not s[i-1] == t[j-1]:
            clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
    if b > a:
        gcd(b, a)
    while b:
	    a, b = b, a % b
    return a

n,m = map(int, input().split())
s = input()
t = input()

l = n * m // gcd(n, m)
a = l // n
b = l // m
#print(a, b)
#a(i-1) = b(j-i) -> ai = bj + (a-b)
res = False
clear_all = True
for i in range(1,n+1):
    for j in range(1,m+1):
        if a * i - b * j == a - b:
            if not s[i-1] == t[j-1]:
                clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)
        

Fixed submission:
def gcd(a, b):
    if b > a:
        gcd(b, a)
    while b:
	    a, b = b, a % b
    return a

n,m = map(int, input().split())
s = input()
t = input()

l = n * m // gcd(n, m)
a = l // n
b = l // m
#print(a, b)
#a(i-1) = b(j-i) -> ai = bj + (a-b)
res = False
clear_all = True
for i in range(1,n+1):
    if (a*i - (a-b)) % b == 0:
        j = (a * i - (a-b)) // b
        if not s[i-1] == t[j-1]:
            clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
s = input()
t = input()

import math
l = n * m // math.gcd(n, m)
a = l // n
b = l // m

res = False
clear_all = True
for i in range(1,n+1):
    for j in range(1,m+1):
        if a * i - b * j == a - b:
            if not s[i-1] == t[j-1]:
                clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)
        

Fixed submission:
def gcd(a, b):
    if b > a:
        gcd(b, a)
    while b:
	    a, b = b, a % b
    return a

n,m = map(int, input().split())
s = input()
t = input()

l = n * m // gcd(n, m)
a = l // n
b = l // m
#print(a, b)
#a(i-1) = b(j-i) -> ai = bj + (a-b)
res = False
clear_all = True
for i in range(1,n+1):
    if (a*i - (a-b)) % b == 0:
        j = (a * i - (a-b)) // b
        if not s[i-1] == t[j-1]:
            clear_all = False
if clear_all:
    res = True
if res:
    print(l)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
N,T=map(int,input().split())
res=2000
for i in N:
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)

Fixed submission:
N,T=map(int,input().split())
res=2000
for i in range(N):
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)

Buggy python submission (verdict: Runtime Error):
N,T=map(int,input().split())
res=2000
for i in N:
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

Fixed submission:
N,T=map(int,input().split())
res=2000
for i in range(N):
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)

Buggy python submission (verdict: Runtime Error):
N,T=map(int,input().split())
res=2000
for i in N:
  c,t=map(int,input())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

Fixed submission:
N,T=map(int,input().split())
res=2000
for i in range(N):
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)

Buggy python submission (verdict: Runtime Error):
N,T=map(int,input())
res=2000
for i in N:
  c,t=map(int,input())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

Fixed submission:
N,T=map(int,input().split())
res=2000
for i in range(N):
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)
Buggy python submission (verdict: Runtime Error):
n = input()
ans = “”
for a in n:
  if a == “1”:
    ans  = ans + “9”
  else:
    ans = ans + “1”
print(ans)


Fixed submission:
n = input()
ans = ''
for a in n:
  if a == '1':
    ans  = ans + '9'
  else:
    ans = ans + '1'
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
ans = “”
for a in n:
  if a == “1”:
    ans  = ans + “9”
  else:
    ans = ans + “1”
print(ans)

Fixed submission:
n = input()
ans = ''
for a in n:
  if a == '1':
    ans  = ans + '9'
  else:
    ans = ans + '1'
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
n = [‘1’ for a in n if a==‘9’ else ‘9’]
print(“”.join(n))

Fixed submission:
n = input()
ans = ''
for a in n:
  if a == '1':
    ans  = ans + '9'
  else:
    ans = ans + '1'
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(inp())
a=n%100
m=a*100+a*10+a
if n<=m:
  print(m)
else:
  print(m+111)

Fixed submission:
n=int(input())
a=n//100
m=a*100+a*10+a
if n<=m:
  print(m)
else:
  print(m+111)
Buggy python submission (verdict: Runtime Error):
L = int(input())
for i in range(20):
    if 2**i >  L :
        r = i-1
        break
        
res = []
for i in range(1, r+1):
    res.append([i, i+1, 0])
    res.append([i, i+1, 2**(i-1)])

for t in range(r, 0, -1):
    if L >= 2**r + 2**(t-1):
        L -= 2**(t-1)
        res.append([t, r+1, L])

print(r+1, len(res))
for i in range(len(res)):
    print(res[i][0], res[i][1], res[i][2])


Fixed submission:
import math
L = int(input())
r = int(math.log2(L))

res = []
for i in range(1, r+1):
    res.append([i, i+1, 0])
    res.append([i, i+1, 2**(i-1)])

for t in range(r, 0, -1):
    if L >= 2**r + 2**(t-1):
        L -= 2**(t-1)
        res.append([t, r+1, L])

print(r+1, len(res))
for i in range(len(res)):
    print(res[i][0], res[i][1], res[i][2])

Buggy python submission (verdict: Runtime Error):
L = int(input())
for i in range(20):
    if 2**i >  L :
        r = i-1
        break
#print(r)

res = []
for i in range(1, r+1):
    res.append([i, i+1, 0])
    res.append([i, i+1, 2**(i-1)])
print(res)

for t in range(r, 0, -1):
    if L >= 2**r + 2**(t-1):
        L -= 2**(t-1)
        res.append([t, r+1, L])

print(r+1, len(res))
for i in range(len(res)):
    print(res[i][0], res[i][1], res[i][2])


Fixed submission:
import math
L = int(input())
r = int(math.log2(L))

res = []
for i in range(1, r+1):
    res.append([i, i+1, 0])
    res.append([i, i+1, 2**(i-1)])

for t in range(r, 0, -1):
    if L >= 2**r + 2**(t-1):
        L -= 2**(t-1)
        res.append([t, r+1, L])

print(r+1, len(res))
for i in range(len(res)):
    print(res[i][0], res[i][1], res[i][2])
Buggy python submission (verdict: Runtime Error):
import sys
N, K = map(int,input().split())
A = list(map(int, input().split()))
if N == K:
    print(1)
    sys.exit()
idx = A.index(1)
res = 0
if idx <= K:
    idx = K-1
    res = 1
else:
    while(True):
        res += 1
        idx -= K - 1
        if idx <= 0:
            break
idx = A.index(1)
if idx <= K:
    idx = K-1
while(True):
    if idx >= N-1:
        break
    res += 1
    idx += K-1

print(res)


Fixed submission:
s = input()
res = 0
for letter in s:
    if letter =='+':
        res += 1
    else:
        res -= 1
print(res)
Buggy python submission (verdict: Runtime Error):
8 3
7 3 1 8 4 6 2 5

Fixed submission:
n,k=map(int,input().split())
a=(n-1)/(k-1)
if a!=int(a):
    print(int(a)+1)
else:
    print(int(a))
Buggy python submission (verdict: Runtime Error):
 a, b = map(int, input().split())
print((a+b) % 24 )

Fixed submission:
a, b = map(int, input().split())
print((a+b) % 24 )
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = [(a, b) for a, b in map(int, input().split())]
C = [(c, d) for c, d in map(int, input().split())]
for i in range(n):
  res = 0
  ans = 1 << 20
  for j in range(m):
    tmp = abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1]) )
    if tmp < ans:
	  ans = tmp
      res = j
  print(j)


Fixed submission:
n, m = map(int, input().split())
A = [tuple(map(int, input().split())) for i in range(n)]
C = [tuple(map(int, input().split())) for j in range(m)]
for i in range(n):
  res = 1 
  ans = abs(A[i][0] - C[0][0]) + abs(A[i][1] - C[0][1])
  for j in range(m):
    tmp = abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1])
    if tmp < ans:
      ans = tmp
      res = j+1
  print(res)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a%2 == 1 .and. b%2 == 1:
    print('Yes')
else:
    print('No')

Fixed submission:
if __name__ == '__main__':
    a = input().split()
    if int(a[0])%2 == 1 and int(a[1])%2 == 1:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    a = input().spit()
    if a[0]%2 == 1 and a[1]%2 == 1:
        print("Yes")
    else:
        print("No")





Fixed submission:
if __name__ == '__main__':
    a = input().split()
    if int(a[0])%2 == 1 and int(a[1])%2 == 1:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
def calc(array, start, k):
    ri = start
    li = start
    
    if start == 0:
        eri = len(array) - 1
        eli = start + 1
    elif start == len(array) - 1:
        eri = start - 1
        eli = 0
    else:
        eri = start - 1
        eli = start + 1
    
    right = 0
    left = 0

    while True:
        if ri + 1 == len(array):
            right += k - array[ri] + array[0]
            ri = 0
        else:
            right += array[ri + 1] - array[ri]
            ri += 1

        if li - 1 < 0:
            left += k - array[-1] + array[li]
            li = len(array) - 1
        else:
            left += array[li] - array[li - 1]
            li -= 1
        #print("start = {}: ri = {}, li = {}".format(start, ri, li))
        #print("right = {}, left = {}".format(right, left))

        if ri == eri and li == eli:
            break

    return min(right, left)

def main():
    tmp = input().split(" ")
    k = int(tmp[0])

    a = input().split(" ")
    a = [int(i) for i in a]

    ans = 300000000
    for i in range(len(a)):
        ans = min(ans, calc(a, i, k))

    print(ans)


if __name__ == '__main__':
    main()

Fixed submission:
def main():
    tmp = input().split(" ")
    k = int(tmp[0])

    a = input().split(" ")
    a = [int(i) for i in a]

    ans = []
    for i in range(len(a)):
        if i == 0:
            ans.append(k - a[-1] + a[i])
        else:
            ans.append(a[i] - a[i - 1])
        
    print(sum(ans) - max(ans))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
    print(a.index(i+1)+1,end=" ")

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

Fixed submission:
n,k,q = map(int,input().split())
a = [0 for i in range(n)]
for i in range(q):
    aa = int(input()) - 1
    a[aa] = a[aa] + 1
for i in a:
    if k - q + i > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
a = []
for i in range(q):
    a.append(int(input()))
for i in range(1,n+1):
    point = a.count(i)
    if k - q + point > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n,k,q = map(int,input().split())
a = [0 for i in range(n)]
for i in range(q):
    aa = int(input()) - 1
    a[aa] = a[aa] + 1
for i in a:
    if k - q + i > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
print((int(input())**3)

Fixed submission:
print((int(input())**3))
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
  return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)

n=int(input())
a=list(map(int,input().split()))
aa=lcm_list(a)
ans=0
for i in a:
  ans+=aa//i
ans=aa/ans
print(ans)

Fixed submission:
import fractions as fr
from functools import reduce

def lcm_base(x, y):
  return (x * y) // fr.gcd(x, y)

def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)

n=int(input())
a=list(map(int,input().split()))
aa=lcm_list(a)
ans=0
for i in a:
  ans+=aa//i
ans=aa/ans
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
  return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)

n=int(input())
a=list(map(int,input().split()))
aa=lcm_list(a)
ans=0
for i in a:
  ans+=aa//i
ans=aa//ans
print(ans)

Fixed submission:
import fractions as fr
from functools import reduce

def lcm_base(x, y):
  return (x * y) // fr.gcd(x, y)

def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)

n=int(input())
a=list(map(int,input().split()))
aa=lcm_list(a)
ans=0
for i in a:
  ans+=aa//i
ans=aa/ans
print(ans)
Buggy python submission (verdict: Runtime Error):
s=list(input())
s1=s[0]
sf=s.count(s1)
for i in range(sf):
  s.remove(s1)
if s[0]==s[1]:
  print("Yes")
else:
  print("No")

Fixed submission:
s=list(input())
s1=s[0]
sf=s.count(s1)
if sf==2:
  for i in range(2):
    s.remove(s1)
  if s[0]==s[1]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s=list(map(int,input().split()))
s1=s[0]
sf=s.count(s1)
for i in range(sf):
  s.remove(s1)
if s[0]==s[1]:
  print("Yes")
else:
  print("No")

Fixed submission:
s=list(input())
s1=s[0]
sf=s.count(s1)
if sf==2:
  for i in range(2):
    s.remove(s1)
  if s[0]==s[1]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(intpu())
p=list(map(int,input().split()))
ans=0
for i in range(len(p)-3):
  if p[i]<p[i+1] and p[i+1]<p[i+2] or p[i]<p[i+1] and p[i+1]<p[i+2]:
    ans=ans+1
print(ans)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(n-2):
  if p[i]<p[i+1] and p[i+1]<p[i+2] or p[i]>p[i+1] and p[i+1]>p[i+2]:
    ans=ans+1
print(ans)
Buggy python submission (verdict: Runtime Error):
W,H,x,y=map(float,input().split())
answer=0
if W//2==x and H//2==y:
  answer=1
print(W*H//2 answer)

Fixed submission:
W,H,x,y=map(float,input().split())
answer=0
if W/2==x and H/2==y:
  answer=1
print(W*H/2,answer)
Buggy python submission (verdict: Runtime Error):
pqr=list(map(int,input().split()))
pqr.sorted()
print(pqr[0]+pqr[1])

Fixed submission:
pqr=list(map(int,input().split()))
pqr.sort()
print(pqr[0]+pqr[1])
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    bi=b*i
    for j in range(n//g+1):
        gj=g*j
        if gj+bi>n:
            break
        elif gj+bi==n:
            ans=ans+1
            break
        elif (n-(gj+bi))%r==0:
            ans=ans+1
print(ans)

Fixed submission:
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    bi=b*i
    for j in range(n//g+1):
        gj=g*j
        if gj+bi>n:
            break
        elif gj+bi==n:
            ans=ans+1
            break
        elif (n-(gj+bi))%r==0:
            ans=ans+1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
rgb=[r,g,b]
rgb.sort()
r=rgb[0]
g=rgb[1]
b=rgb[2]
ans=0
for i in range(n//b+1):
    for j in range(n//g+1):
        if g*j+b*i==n:
            ans=ans+1
        elif g*j+b*i>n:
            break
        elif (n-(g*j+b*i))%r==0:
            ans=ans+1
print(ans)

Fixed submission:
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    bi=b*i
    for j in range(n//g+1):
        gj=g*j
        if gj+bi>n:
            break
        elif gj+bi==n:
            ans=ans+1
            break
        elif (n-(gj+bi))%r==0:
            ans=ans+1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    for j in range(n//g+1):
        if g*j+b*i==n:
            ans=ans+1
        elif g*j+b*i>n:
            break
        elif (n-(g*j+b*i))%r==0:
            ans=ans+1
print(ans)

Fixed submission:
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    bi=b*i
    for j in range(n//g+1):
        gj=g*j
        if gj+bi>n:
            break
        elif gj+bi==n:
            ans=ans+1
            break
        elif (n-(gj+bi))%r==0:
            ans=ans+1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    for j in range(n//g+1):
        for k in range(n//r+1):
            if r*k+g*j+b*i==n:
                ans=ans+1
            elif r*k+g*j+b*i>n:
                break
        if g*j+b*i>n:
            break
print(ans)

Fixed submission:
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    bi=b*i
    for j in range(n//g+1):
        gj=g*j
        if gj+bi>n:
            break
        elif gj+bi==n:
            ans=ans+1
            break
        elif (n-(gj+bi))%r==0:
            ans=ans+1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    for j in range(n//g+1):
        for k in range(n//r+1):
            if r*k+g*j+b*i==n:
                ans=ans+1
            elif r*k+g*j+b*i>n:
                break
print(ans)

Fixed submission:
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//b+1):
    bi=b*i
    for j in range(n//g+1):
        gj=g*j
        if gj+bi>n:
            break
        elif gj+bi==n:
            ans=ans+1
            break
        elif (n-(gj+bi))%r==0:
            ans=ans+1
print(ans)
Buggy python submission (verdict: Runtime Error):
abc=list(map(int,input().split()))
if max(abc)=abc[2]:
  print("Yes")
else:
  print("No")

Fixed submission:
abc=list(map(int,input().split()))
if max(abc)==abc[0] and min(abc)==abc[1] or max(abc)==abc[1] and min(abc)==abc[0]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
k=int(input())
for i in range(n):
  if s[i]!=s[k]:
    print("*",end="")
  else:
    print(s[i],end="")

Fixed submission:
n=int(input())
s=list(input())
k=int(input())
for i in range(n):
  if s[i]!=s[k-1]:
    print("*",end="")
  else:
    print(s[i],end="")

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
k=int(input())
a=0
a=s[k]
for i in range(n):
  if k[i]!=a:
    print("*",end="")
  else:
    print(k[i],end="")

Fixed submission:
n=int(input())
s=list(input())
k=int(input())
for i in range(n):
  if s[i]!=s[k-1]:
    print("*",end="")
  else:
    print(s[i],end="")
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=[list(map(int,input().split()))]
high=0
count=0
for i in range(n):
  if high<=h[i]:
    count=count+1
    high=h[i]
print(count)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
high=0
count=0
for i in range(n):
  if high<=h[i]:
    count=count+1
    high=h[i]
print(count)