Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()
words = ['dream', 'dreamer', 'erase', 'eraser']


def dfs(n):
    if n == len(s):
        return True
    for w in words:
        if s[n:].startswith(w):
            if dfs(n + len(w)):
                return True
    return False


if dfs(0):
    print('YES')
else:
    print('NO')


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()
revs = s[::-1]
words = ['maerd', 'remaerd', 'esare', 'resare']


def scan(n):
    for w in words:
        if revs[n:].startswith(w):
            return len(w)
    print('NO')
    exit()


n = 0
while revs[n:] != '':
    n += scan(n)

print('YES')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()
words = ['dream', 'dreamer', 'erase', 'eraser']
L = len(max(words, key=len))


def dfs(n):
    if n == len(s):
        return True
    for w in words:
        if w in s[n:n + L]:
            if dfs(n + len(w)):
                return True
    return False


if dfs(0):
    print('YES')
else:
    print('NO')


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()
revs = s[::-1]
words = ['maerd', 'remaerd', 'esare', 'resare']


def scan(n):
    for w in words:
        if revs[n:].startswith(w):
            return len(w)
    print('NO')
    exit()


n = 0
while revs[n:] != '':
    n += scan(n)

print('YES')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()
words = ['dream', 'dreamer', 'erase', 'eraser']


def dfs(n):
    if n == len(s):
        return True
    for w in words:
        if w in s[n:]:
            if dfs(n + len(w)):
                return True
    return False


if dfs(0):
    print('YES')
else:
    print('NO')


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

s = input()
revs = s[::-1]
words = ['maerd', 'remaerd', 'esare', 'resare']


def scan(n):
    for w in words:
        if revs[n:].startswith(w):
            return len(w)
    print('NO')
    exit()


n = 0
while revs[n:] != '':
    n += scan(n)

print('YES')
Buggy python submission (verdict: Runtime Error):
n, a = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]

nx = n * max(max(x), a)
dp = [[[0 for k in range(nx + 1)] for j in range(n + 1)] for i in range(n + 1)]
dp[0][0][0] = 1

for i in range(n):
    for j in range(n):
        for k in range(nx):
            if k + x[j] <= n * a:
                dp[i + 1][j + 1][k + x[i]] += dp[i][j][k]
            dp[i + 1][j][k] += dp[i][j][k]

ans = sum([dp[n][k][k * a] for k in range(1, n + 1)])
print(ans)


Fixed submission:
n, a = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]

nx = n * max(max(x), a)
y = [xi - a for xi in x]
dp = [[0 for j in range(2 * nx + 1)] for i in range(n + 1)]
dp[0][nx] = 1

for i in range(n):
    for j in range(2 * nx + 1):
        if not 0 <= j - y[i] <= 2 * nx:
            dp[i + 1][j] = dp[i][j]
        elif j - y[i] <= 2 * nx:
            dp[i + 1][j] = dp[i][j] + dp[i][j - y[i]]

print(dp[n][nx] - 1)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = map(int, input())
A = list(map(int, input().split()))

while len(A) >= 2:
    x = A.pop(A.index(max(A)))
    y = min(A)
    n = x % y
    if n == 0:
        pass
    else:
        A.append(n)

print(A[0])


Fixed submission:
# -*- coding: utf-8 -*-
N = map(int, input())
A = list(map(int, input().split()))

while len(A) >= 2:
    idx = A.index(min(A))
    x = A.pop(idx)
    B = list()
    for i in range(len(A)):
        if A[i] % x != 0:
            B.append(A[i] % x)
    B.append(x)
    A = B[:]

print(A[0])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = map(int, input())
A = list(map(int, input().split()))

while len(A) >= 2:
    x = A.pop(A.index(max(A)))
    n = x
    for i in range(len(A)):
        if x % A[i] > 0:
            n = min(n, x % A[i])

    if n == x:
        pass
    else:
        A.append(n)

print(A[0])


Fixed submission:
# -*- coding: utf-8 -*-
N = map(int, input())
A = list(map(int, input().split()))

while len(A) >= 2:
    idx = A.index(min(A))
    x = A.pop(idx)
    B = list()
    for i in range(len(A)):
        if A[i] % x != 0:
            B.append(A[i] % x)
    B.append(x)
    A = B[:]

print(A[0])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = map(int, input())
A = list(map(int, input().split()))

while len(A) >= 2:
    x = A.pop(A.index(max(A)))
    n = x
    for i in range(len(A)):
        if x % A[i] > 0:
            n = min(x, x % A[i])

    if n == x:
        pass
    else:
        A.append(n)

print(A[0])


Fixed submission:
# -*- coding: utf-8 -*-
N = map(int, input())
A = list(map(int, input().split()))

while len(A) >= 2:
    idx = A.index(min(A))
    x = A.pop(idx)
    B = list()
    for i in range(len(A)):
        if A[i] % x != 0:
            B.append(A[i] % x)
    B.append(x)
    A = B[:]

print(A[0])
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
nF = list(map(str, input().split('T')))
finalx, finaly = list(map(int, input().split()))

x = []
y = []
for i in range(len(nF)):
    if i % 2 == 0:
        x.append(len(nF[i]))
    else:
        y.append(len(nF[i]))

posy = [0]
if len(x) == 0:
    posx = [0]
elif len(x) == 1:
    posx = [x[0]]
else:
    posx = [x[0]]
    for i in range(1, len(x)):
        plus_x = list(map(lambda elem: elem + x[i], posx))
        minus_x = list(map(lambda elem: elem - x[i], posx))
        plus_x.extend(minus_x)
        posx = plus_x

if len(y) >= 1:
    for i in range(len(y)):
        plus_y= list(map(lambda elem: elem + y[i], posy))
        minus_y= list(map(lambda elem: elem - y[i], posy))
        plus_y.extend(minus_y)
        posy = plus_y

if finalx in posx and finaly in posy:
    print('Yes')
else:
    print('No')



Fixed submission:
# -*- coding: utf-8 -*-
nF = list(map(str, input().split('T')))
finalx, finaly = list(map(int, input().split()))

x = []
y = []
for i in range(len(nF)):
    if i % 2 == 0:
        x.append(len(nF[i]))
    else:
        y.append(len(nF[i]))

posy = [0]
if len(x) == 0:
    posx = [0]
elif len(x) == 1:
    posx = [x[0]]
else:
    posx = [x[0]]
    for i in range(1, len(x)):
        plus_x = list(map(lambda elem: elem + x[i], posx))
        minus_x = list(map(lambda elem: elem - x[i], posx))
        plus_x.extend(minus_x)
        posx = list(set(plus_x))

if len(y) >= 1:
    for i in range(len(y)):
        plus_y= list(map(lambda elem: elem + y[i], posy))
        minus_y= list(map(lambda elem: elem - y[i], posy))
        plus_y.extend(minus_y)
        posy = list(set(plus_y))

if finalx in posx and finaly in posy:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A,B,C,D = list(map(int, list(input())))

if A+B+C+D == 7:
    print(A+'+'+B+'+'+C+'+'+D+'=7')
elif A+B+C-D == 7:
    print(A+'+'+B+'+'+C+'-'+D+'=7')
elif A+B-C+D == 7:
    print(A+'+'+B+'-'+C+'+'+D+'=7')
elif A+B-C-D == 7:
    print(A+'+'+B+'-'+C+'-'+D+'=7')
elif A-B+C+D == 7:
    print(A+'-'+B+'+'+C+'+'+D+'=7')
elif A-B+C-D == 7:
    print(A+'-'+B+'+'+C+'-'+D+'=7')
elif A-B-C+D == 7:
    print(A+'-'+B+'-'+C+'+'+D+'=7')
elif A-B-C-D == 7:
    print(A+'-'+B+'-'+C+'-'+D+'=7')



Fixed submission:
# -*- coding: utf-8 -*-
A,B,C,D = list(map(int, list(input())))

if A+B+C+D == 7:
    print(str(A)+'+'+str(B)+'+'+str(C)+'+'+str(D)+'=7')
elif A+B+C-D == 7:
    print(str(A)+'+'+str(B)+'+'+str(C)+'-'+str(D)+'=7')
elif A+B-C+D == 7:
    print(str(A)+'+'+str(B)+'-'+str(C)+'+'+str(D)+'=7')
elif A+B-C-D == 7:
    print(str(A)+'+'+str(B)+'-'+str(C)+'-'+str(D)+'=7')
elif A-B+C+D == 7:
    print(str(A)+'-'+str(B)+'+'+str(C)+'+'+str(D)+'=7')
elif A-B+C-D == 7:
    print(str(A)+'-'+str(B)+'+'+str(C)+'-'+str(D)+'=7')
elif A-B-C+D == 7:
    print(str(A)+'-'+str(B)+'-'+str(C)+'+'+str(D)+'=7')
elif A-B-C-D == 7:
    print(str(A)+'-'+str(B)+'-'+str(C)+'-'+str(D)+'=7')

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A,B,C,D = list(map(int, input().split()))

if A+B+C+D == 7:
    print('A+B+C+D=7')
elif A+B+C-D == 7:
    print('A+B+C-D=7')
elif A+B-C+D == 7:
    print('A+B-C+D=7')
elif A+B-C-D == 7:
    print('A+B-C-D=7')
elif A-B+C+D == 7:
    print('A-B+C+D=7')
elif A-B+C-D == 7:
    print('A-B+C-D=7')
elif A-B-C+D == 7:
    print('A-B-C+D=7')
elif A-B-C-D == 7:
    print('A-B-C-D=7')



Fixed submission:
# -*- coding: utf-8 -*-
A,B,C,D = list(map(int, list(input())))

if A+B+C+D == 7:
    print(str(A)+'+'+str(B)+'+'+str(C)+'+'+str(D)+'=7')
elif A+B+C-D == 7:
    print(str(A)+'+'+str(B)+'+'+str(C)+'-'+str(D)+'=7')
elif A+B-C+D == 7:
    print(str(A)+'+'+str(B)+'-'+str(C)+'+'+str(D)+'=7')
elif A+B-C-D == 7:
    print(str(A)+'+'+str(B)+'-'+str(C)+'-'+str(D)+'=7')
elif A-B+C+D == 7:
    print(str(A)+'-'+str(B)+'+'+str(C)+'+'+str(D)+'=7')
elif A-B+C-D == 7:
    print(str(A)+'-'+str(B)+'+'+str(C)+'-'+str(D)+'=7')
elif A-B-C+D == 7:
    print(str(A)+'-'+str(B)+'-'+str(C)+'+'+str(D)+'=7')
elif A-B-C-D == 7:
    print(str(A)+'-'+str(B)+'-'+str(C)+'-'+str(D)+'=7')
Buggy python submission (verdict: Runtime Error):
s = str(input())
if s[1] = "A" and [s[3], s[-2] ].count("C") == 1 :
    s[1] = a
    s[3] = a
    s[-2] = a
    a = ""
    for i in s:
        a = a + s
    if a.islower() :
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Fixed submission:
ss = str(input())
s = list(ss)

if s[0] == "A" and s.count("A") == 1:
    checklist = []
    for i in range(2,len(s)-1):
        checklist.append(s[i])
        
    if checklist.count("C") == 1:
        s.remove("A")
        s.remove("C")
        p = ""
        for i in s:
            p = p + i
        if p.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
tt = list(map(int,input().split()))
    
ss = 1

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i) // q[0]
num = ss
kouho = 0
for num in range(1,num + 1):
    onesum = 0
    for onenum in tt:
        onesum += num % onenum
    if kouho < onesum:
        kouho = onesum
print(kouho)


Fixed submission:
n = int(input())
tt = list(map(int,input().split()))
    
ss = 1

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i) // q[0]
num = ss
kouho = 0

for onenum in tt:
    kouho += (num-1) % onenum

print(kouho)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = a.sort()
print(abs(b[0] - b[-1]))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(sorted(a))
print(abs(b[0] - b[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
aa = list(map(int,input().split()))

a = []
for i in range(n):
    a.append(aa[i]-(i+1))
    
b = {}
for i in a:
    if i in b:
        b[i] += 1
    else:
        b.update({i:1})
        
ans_l = []
for k in b.keys():
    counts = 0
    for k_, val in b.items():
        counts += (abs(k - k_)) * val
    ans_l.append(counts)
    
print(min(ans_l))

Fixed submission:
n = int(input())
aa = list(map(int,input().split()))

a = []
for i in range(n):
    a.append(aa[i]-(i+1))
b = list(sorted(a))

ans = 0

for i in range(n//2):
    ans += b[-i-1] - b[i]
print(ans)

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

a = []
for i in range(n):
    a.append(aa[i]-(i+1))
        
c = list(set(a))

#print(c[-1][0])

count = []

for i in c:
    counts = 0
    for j in a:
        counts += abs(j-i)
    count.append(counts)
print(min(count))

Fixed submission:
n = int(input())
aa = list(map(int,input().split()))

a = []
for i in range(n):
    a.append(aa[i]-(i+1))
b = list(sorted(a))

ans = 0

for i in range(n//2):
    ans += b[-i-1] - b[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())

if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

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

if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

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

if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

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

if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

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

if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":()")

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

if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
d,n  = map(int,input().split())
l1 = []
l2 = []


        
if d == 0:
    print(n)
elif d == 1:
    if n != 100:
        print(n * 100)
    else:
        print(10100)
else:
    if n! = 100:
        print(n * 10000)
    else:
        print(1010000)

Fixed submission:
d,n  = map(int,input().split())
l1 = []
l2 = []


        
if d == 0:
    if n != 100:
        print(n)
    else:
        print(101)
elif d == 1:
    if n != 100:
        print(n * 100)
    else:
        print(10100)
else:
    if n != 100:
        print(n * 10000)
    else:
        print(1010000)

Buggy python submission (verdict: Runtime Error):
d,n  = map(int,input().split())
l1 = []
l2 = []


        
if d == 0:
    print(n)
elif d == 1:
    if n != 100:
        print(n * 100)
    else:
        print(10100)
else:
    if n! = 100:
        print(n * 10000)
    else:
        print(1010000)

Fixed submission:
d,n  = map(int,input().split())
l1 = []
l2 = []


        
if d == 0:
    if n != 100:
        print(n)
    else:
        print(101)
elif d == 1:
    if n != 100:
        print(n * 100)
    else:
        print(10100)
else:
    if n != 100:
        print(n * 10000)
    else:
        print(1010000)

Buggy python submission (verdict: Runtime Error):
d,n  = map(int,input().split())
l1 = []
l2 = []

for i in range(1,100000):
    if i % 100 == 0 and i % 10000!= 0:
        l1.append(i)
    if i % 10000 == 0 and i % 1000000!= 0:
        l2.append(i)
        
if d == 0:
    print(n)
elif d == 1:
    print(l1[n-1])
else:
    print(l2[n-1])

Fixed submission:
d,n  = map(int,input().split())
l1 = []
l2 = []


        
if d == 0:
    if n != 100:
        print(n)
    else:
        print(101)
elif d == 1:
    if n != 100:
        print(n * 100)
    else:
        print(10100)
else:
    if n != 100:
        print(n * 10000)
    else:
        print(1010000)

Buggy python submission (verdict: Runtime Error):
d,n  = map(int,input().split())
l1 = []
l2 = []

for i in range(1,1000000):
    if i % 100 == 0 and i % 10000!= 0:
        l1.append(i)
    if i % 10000 == 0 and i % 1000000!= 0:
        l2.append(i)
        
if d == 0:
    print(n)
elif d == 1:
    print(l1[n-1])
else:
    print(l2[n-1])

Fixed submission:
d,n  = map(int,input().split())
l1 = []
l2 = []


        
if d == 0:
    if n != 100:
        print(n)
    else:
        print(101)
elif d == 1:
    if n != 100:
        print(n * 100)
    else:
        print(10100)
else:
    if n != 100:
        print(n * 10000)
    else:
        print(1010000)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())
ans = 0

for i in range(1,len(s)):
    #print(t[:i], t[i:])
    left = list(t[:i])
    right = list(t[i:])
    kyoutuu = set(left) & set(right)
    ans = max(ans,len(list(kyoutuu)))
print(ans)

Fixed submission:
n = int(input())
t = str(input())
ans = 0
for i in range(1,len(t)):
    #print(t[:i], t[i:])
    left = list(t[:i])
    right = list(t[i:])
    #print(left,right)
    kyoutuu = set(left) & set(right)
    j = len(list(kyoutuu))
    if ans < j:
        ans = j
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())
ans = 0
for i in range(1,len(s)):
    #print(t[:i], t[i:])
    left = set(list(t[:i]))
    right = set(list(t[i:]))
    kyoutuu = left & right
    ans = max(ans,len(list(kyoutuu)))
print(ans)

Fixed submission:
n = int(input())
t = str(input())
ans = 0
for i in range(1,len(t)):
    #print(t[:i], t[i:])
    left = list(t[:i])
    right = list(t[i:])
    #print(left,right)
    kyoutuu = set(left) & set(right)
    j = len(list(kyoutuu))
    if ans < j:
        ans = j
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())
ans = 0
for i in range(1,len(s)):
    #print(t[:i], t[i:])
    left = set(list(t[:1]))
    right = set(list(t[i:]))
    kyoutuu = left & right
    ans = max(ans,kyoutuu)
print(y)

Fixed submission:
n = int(input())
t = str(input())
ans = 0
for i in range(1,len(t)):
    #print(t[:i], t[i:])
    left = list(t[:i])
    right = list(t[i:])
    #print(left,right)
    kyoutuu = set(left) & set(right)
    j = len(list(kyoutuu))
    if ans < j:
        ans = j
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())
ans = 0
for i in range(1,len(s)):
    #print(t[:i], t[i:])
    left = set(list(t[:1]))
    right = set(list(t[i:]))
    kyoutuu = left & right
    y = len(list((1,2,3)))
    ans = max(ans,y)
print(y)

Fixed submission:
n = int(input())
t = str(input())
ans = 0
for i in range(1,len(t)):
    #print(t[:i], t[i:])
    left = list(t[:i])
    right = list(t[i:])
    #print(left,right)
    kyoutuu = set(left) & set(right)
    j = len(list(kyoutuu))
    if ans < j:
        ans = j
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())
ans = 0
for i in range(1,len(s)):
    print(t[:i], t[i:])
    left = set(list(t[:1]))
    right = set(list(t[i:]))
    kyoutuu = left & right
    y = len(list((1,2,3)))
    ans = max(ans,y)
print(y)

Fixed submission:
n = int(input())
t = str(input())
ans = 0
for i in range(1,len(t)):
    #print(t[:i], t[i:])
    left = list(t[:i])
    right = list(t[i:])
    #print(left,right)
    kyoutuu = set(left) & set(right)
    j = len(list(kyoutuu))
    if ans < j:
        ans = j
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

if a = b :
    print(a)
elif a > b:
    print(a-1)
elif a < b:
    print(a)

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

if a == b :
    print(a)
elif a > b:
    print(a-1)
elif a < b:
    print(a)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
k = int(input())
lm = list(sorted([a,b,c]))

c = lm[2]
lm.remove(c)

for i in range(k):
    c = c * 2
    
print(lm[1] + lm[2] + c)

Fixed submission:
a,b,c = map(int,input().split())
k = int(input())
lm = list(sorted([a,b,c]))

c = lm[2]
lm.remove(c)

for i in range(k):
    c = c * 2
    
print(lm[0] + lm[1] + c)
Buggy python submission (verdict: Runtime Error):
s = list(str(input()))
p = 0
for i in s:
    if i == o:
        p = p + 100
        
print(700 + p)

Fixed submission:
s = list(str(input()))
p = 0
for i in s:
    if i == 'o':
        p = p + 100
        
print(700 + p)

Buggy python submission (verdict: Runtime Error):
s = str(input())
p = 0
for i in s:
    if i == o:
        p = p + 100
        
print(700 + p)

Fixed submission:
s = list(str(input()))
p = 0
for i in s:
    if i == 'o':
        p = p + 100
        
print(700 + p)

Buggy python submission (verdict: Runtime Error):
s = str(int,input())
p = 0
for i in s:
    if i == o:
        p = p + 100
        
print(700 + p)

Fixed submission:
s = list(str(input()))
p = 0
for i in s:
    if i == 'o':
        p = p + 100
        
print(700 + p)
Buggy python submission (verdict: Runtime Error):
n, x = map(int,input().split())
m = []
mall = 0
for i in range(n):
    mone = int(input())
    mall = mall + mone
    
y = x - mall
mm = []
p = y // (min(m))

print(p + n)


Fixed submission:
n, x = map(int,input().split())
m = []
mall = 0
for i in range(n):
    mone = int(input())
    mall = mall + mone
    m.append(mone)
    
y = x - mall
mm = []
p = y // (min(m))

print(p + n)
Buggy python submission (verdict: Runtime Error):
a_yen , b_yen, c_yen , a_count,b_count = map(int,input().split())

abmax = max(a_count, b_count)
c_count = 0
kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count

while c <= 2*abmax:
    if kouhopiza > a_yen * a_count + b_yen * b_count + c_yen * c_count and a_count > -1 and b_count > -1:
        kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count
    c_count = c_count + 2
    a_count = a_count - 1
    b_count = b_count - 1





Fixed submission:
a_yen , b_yen, c_yen , a_count,b_count = map(int,input().split())

abmax = max(a_count, b_count)
c_count = 0
kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count

while c_count <= 2*abmax:
    if kouhopiza > a_yen * a_count + b_yen * b_count + c_yen * c_count and a_count > -1 and b_count > -1:
        kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count
    elif a_count > -1 and b_count < 0:
        if kouhopiza > a_yen * a_count + c_yen * c_count:
            kouhopiza = a_yen * a_count + c_yen * c_count
    elif a_count < 0 and b_count > -1:
        if kouhopiza > b_yen * b_count + c_yen * c_count:
            kouhopiza = b_yen * b_count + c_yen * c_count
        
    c_count = c_count + 2
    a_count = a_count - 1
    b_count = b_count - 1
print(kouhopiza)

Buggy python submission (verdict: Runtime Error):
a_yen , b_yen, c_yen , a_count,b_count = map(int,input().split())

abmax = max(a_count, b_count)
c_count = 0
kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count

while c <= 2*abmax:
    if kouhopiza > a_yen * a_count + b_yen * b_count + c_yen * c_count and a_counnt > -1 and b_count > -1:
        kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count
    c_count = c_count + 2
    a_count = a_count - 1
    b_count = b_count - 1





Fixed submission:
a_yen , b_yen, c_yen , a_count,b_count = map(int,input().split())

abmax = max(a_count, b_count)
c_count = 0
kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count

while c_count <= 2*abmax:
    if kouhopiza > a_yen * a_count + b_yen * b_count + c_yen * c_count and a_count > -1 and b_count > -1:
        kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count
    elif a_count > -1 and b_count < 0:
        if kouhopiza > a_yen * a_count + c_yen * c_count:
            kouhopiza = a_yen * a_count + c_yen * c_count
    elif a_count < 0 and b_count > -1:
        if kouhopiza > b_yen * b_count + c_yen * c_count:
            kouhopiza = b_yen * b_count + c_yen * c_count
        
    c_count = c_count + 2
    a_count = a_count - 1
    b_count = b_count - 1
print(kouhopiza)
Buggy python submission (verdict: Runtime Error):
n = int(input())
trv = [[0,0,0]]
for i in range(n):
    t,x,y = map(int,input().split())
    a = [t,x,y]
    trv.append(a)

flag = 1
for i in range(1,len(trv)+1):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time < dist:
        flag = 0
        break
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('No')
else:
    print('Yes')

Fixed submission:
n = int(input())
trv = [[0,0,0]]
for i in range(n):
    t,x,y = map(int,input().split())
    a = [t,x,y]
    trv.append(a)

flag = 1

for i in range(1,len(trv)):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time < dist:
        flag = 0
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('No')
else:
    print('Yes')