qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a, b, c, x, y= map(int, input().split())

price = []
for i in range(10**5):
    price.append(i * 2*c + max(0,x-i) * a + max(0,y-i) * b)
print(min(price))

Fixed code:
a, b, c, x, y= map(int, input().split())

price = []
for i in range(10**5+1):
    price.append(i * 2*c + max(0,x-i) * a + max(0,y-i) * b)
print(min(price))
Buggy code:
A, B, C, X, Y = map(int, input().split())
ans = 10**18
Z = max(X, Y)
for i in range(Z+1):
  price = C*i + A*max(0, X-i) + B*max(0, Y-i)
  ans = min(ans, price)

print(ans)

Fixed code:
A, B, C, X, Y = map(int, input().split())
ans = 10**18
Z = max(X, Y)
for i in range(Z+1):
  price = 2*C*i + A*max(0, X-i) + B*max(0, Y-i)
  ans = min(ans, price)

print(ans)
Buggy code:
A, B, C, X, Y = map(int,input().split())
ans = float('inf')
for i in range(max(X,Y)):
  num = i*C + min(0, X-i)*A + min(0, Y-i)*B
  ans = min(ans, num)
print(ans)


Fixed code:
A, B, C, X, Y = map(int,input().split())
ans = float('inf')
for i in range(0, max(X,Y)+1):
  num = i*2*C + max(0, X-i)*A + max(0, Y-i)*B
  ans = min(ans, num)
print(ans)
Buggy code:
a, b, c, x, y = map(int, input().split())

if x==y:
    each = 0
elif x>y:
    each = a*(x-y)
else:
    each = b*(y-x)

print(min(x, y)*2*c+each)

Fixed code:
a, b, c, x, y = map(int, input().split())
each = 0
if x==y:
    each = 0
elif x>y:
    each = min(a, 2*c)*(x-y)
else:
    each = min(b, 2*c)*(y-x)

print(min(min(x, y)*2*c+each, min(a, 2*c)*x + min(b, 2*c)*y))
Buggy code:
A, B, C, X, Y = map(int,input().split())
if A+B <= C*2:
  print(A*X + B*Y)
else:
  if X>=Y:
    print(Y*C + (X-Y)*A)
  else:
    print(X*C + (Y-X)*B)


Fixed code:
A, B, C, X, Y = map(int, input().split())
if A+B > 2*C:
    if X < Y:
        if B*(Y-X)+2*C*X > 2*C*Y:
            print(2*C*Y)
        else:
            print(B*(Y-X)+2*C*X)
    else:
        if A*(X-Y)+2*C*Y > 2*C*X:
            print(2*C*X)
        else:
            print(A*(X-Y)+2*C*Y)
else:
    print(A*X+B*Y)
Buggy code:
A, B, C, X, Y = map(int, input().split())
if A+B <= 2*C:
    ans = A*X+B*Y
else:
    c = min(X, Y)
    x = X-c
    y = Y-c
    ans = 2*C*c +min(A*x+B*y, 2*C*x+2*C*x)
print(ans)

Fixed code:
A, B, C, X, Y = map(int, input().split())
if A+B <= 2*C:
    ans = A*X+B*Y
else:
    c = min(X, Y)
    x = X-c
    y = Y-c
    ans = 2*C*c +min(A*x+B*y, 2*C*x+2*C*y)
print(ans)
Buggy code:
a,b,c,x,y=map(int,input().split())
l=[]
for i in range(10**8):
    s=c*i*2+a*max(0,x-i)+b*max(0,y-i)
    l.append(s)
print(min(l))


Fixed code:
a,b,c,x,y=map(int,input().split())
l=[]
for i in range(10**6):
    s=c*i*2+a*max(0,x-i)+b*max(0,y-i)
    l.append(s)
print(min(l))
Buggy code:
A, B, C, X, Y = map(int, input().split())

ans = float("inf")

if X > Y:
    a = 0
    b = 0
    ab = 2 * X
    while ab > 0:
        a += X - (ab / 2)
        if ab / 2 < Y:
            b = int(Y - 2 * ab)
        money = a * A + b * B + ab * C
        ans = min(ans, money)
        ab -= 2
else:
    a = 0
    b = 0
    ab = 2 * Y
    while ab > 0:
        b += Y - (ab / 2)
        if ab / 2 < X:
            a = int(X - 2 * ab)
        money = a * A + b * B + ab * C
        ans = min(ans, money)
        ab -= 2
print(int(ans))


Fixed code:
A, B, C, X, Y = map(int, input().split())

ans = float("inf")

if X > Y:
    ab = 2 * X
    while ab >= 0:
        a = X - (ab / 2)
        if ab / 2 < Y:
            b = int(Y - ab / 2)
        else:
            b = 0
        money = a * A + b * B + ab * C
        ans = min(ans, money)
        ab -= 2
else:
    ab = 2 * Y
    while ab >= 0:
        b = Y - (ab / 2)
        if ab / 2 < X:
            a = int(X - ab / 2)
        else:
            a = 0
        money = a * A + b * B + ab * C
        ans = min(ans, money)
        ab -= 2
print(int(ans))
Buggy code:
a,b,c,x,y=map(int,input().split())
ans=0
if a+b>=c*2:
    print(a*x+b*y)
    exit()
elif x>=y:
    ans+=c*y
    x-=y
    if a>=c*2:
        ans+=c*2*x
    else:
        ans+=a*x
elif y>x:
    ans+=c*y
    y-=x
    if b>=c*2:
        ans+=c*2*y
    else:
        ans+=b*x
print(ans)


Fixed code:
a,b,c,x,y=map(int,input().split())
ans=0
if a+b<=c*2:
    print(a*x+b*y)
    exit()
elif x>=y:
    ans+=c*y*2
    x-=y
    if a>=c*2:
        ans+=c*2*x
    else:
        ans+=a*x
elif y>x:
    ans+=c*x*2
    y-=x
    if b>=c*2:
        ans+=c*2*y
    else:
        ans+=b*y
print(ans)
Buggy code:
A,B,C,X,Y=map(int,input().split())
cost=A*X+B*Y
Z=min(X,Y)
for i in range(0,2*Z+1,2):
    cost=min(cost,C*i+A*(X-(i//2))+B*(Y-(i//2)))
print(cost)

Fixed code:
A,B,C,X,Y=map(int,input().split())
cost=A*X+B*Y
Z=max(X,Y)
for i in range(0,2*Z+1,2):
    x=max(0,X-(i//2))
    y=max(0,Y-(i//2))
    cost=min(cost,C*i+A*x+B*y)
print(cost)
Buggy code:
A,B,AB,X,Y=map(int,input().split())
ANS=0
if A + B >= AB * 2:
  if min(X,Y) == X:
    # X < Y
    ANS = AB * X * 2
    R = Y - X if Y - X > 0 else 0
   
    if B <= AB * 2:
      ANS += B * R
    else:
      ANS += AB * 2 * R
  else:
    # X > Y
    ANS = AB * Y * 2 if Y - X > 0 else 0
    R = X - Y
    if A <= AB * 2:
      ANS += A * R
    else:
      ANS += AB * 2 * R
else:
  ANS = A * X + B * Y
print(ANS)


Fixed code:
A,B,AB,X,Y=map(int,input().split())
ANS=0
if A + B >= AB * 2:
  if min(X,Y) == X:
    # X < Y
    ANS = AB * X * 2
    R = Y - X if Y - X > 0 else 0
   
    if B <= AB * 2:
      ANS += B * R
    else:
      ANS += AB * 2 * R
  else:
    # X > Y
    ANS = AB * Y * 2
    R = X - Y if X - Y > 0 else 0
    if A <= AB * 2:
      ANS += A * R
    else:
      ANS += AB * 2 * R
else:
  ANS = A * X + B * Y
print(ANS)
Buggy code:
A, B, C, X, Y = map(int, input().split())

if Y - X > 0:
	ans_1 = min(X, Y) * C * 2 + (Y - X) * B
else:
  ans_1 = min(X, Y) * C * 2 + (X - Y) * B

ans_2 = max(Y, X) * C * 2

print(min(ans_1, ans_2))

Fixed code:
A, B, C, X, Y = map(int, input().split())

if Y - X > 0:
    ans_1 = min(X, Y) * C * 2 + (Y - X) * B
else:
    ans_1 = min(X, Y) * C * 2 + (X - Y) * A

ans_2 = max(Y, X) * C * 2

ans_3 = X * A + Y * B

print(min(ans_1, ans_2, ans_3))
Buggy code:
A, B, C, X, Y = map(int, input().split())

if A+B <= C*2:
    min_cost = A*X + B*Y
    
else:
    if X <= Y:
        if B >= C*2:
            min_cost = C*2*X+C*2*(Y-X)
        else:
            min_cost = C*2*X+B*(Y-X)
            
    else:
        if A >= C*2:
            min_cost = C*2*Y+C*2*(X-Y)
        else:
            min_cost = C*2*Y+A*(Y-X)

print(min_cost)
         

Fixed code:
A, B, C, X, Y = map(int, input().split())

if A+B <= C*2:
    min_cost = A*X + B*Y
    
else:
    if X <= Y:
        if B >= C*2:
            min_cost = C*2*X+C*2*(Y-X)
        else:
            min_cost = C*2*X+B*(Y-X)
            
    else:
        if A >= C*2:
            min_cost = C*2*Y+C*2*(X-Y)
        else:
            min_cost = C*2*Y+A*(X-Y)

print(min_cost)
Buggy code:
A, B, C, X, Y = list(map(int, input().split()))

ans = float('infinity')
for i in range(max(X, Y)):
    ans = min((X - i) * A + (Y - i) * B + i * C * 2, ans)

print(ans)


Fixed code:
A, B, C, X, Y = list(map(int, input().split()))

ans = float('infinity')
for i in range(max(X + 1, Y + 1)):
    ans = min(max((X - i), 0) * A + max((Y - i), 0) * B + i * C * 2, ans)

print(ans)
Buggy code:
A,B,C,X,Y = map(int,input().split())
fewer = min(X,Y)
addition = 0
if X > Y:
    addition = A
elif X < Y:
    addition = B
    
print(min(A*X + B*Y, 2*C*fewer + abs(X-Y)*addition))

Fixed code:
A,B,C,X,Y = map(int,input().split())
addition = 0
if X > Y:
    addition = A
elif X < Y:
    addition = B
    
print(min(A*X + B*Y, 2*C*min(X,Y) + abs(X-Y)*addition, 2*C*max(X,Y)))
Buggy code:
a,b,c,x,y=map(int,input().split())
ans=float("inf")
for i in range(max(x,y)-1):
    t=a*(x-min(x,i))+b*(y-min(y,i))+2*c*i
    ans=min(ans,t)
print(ans)

Fixed code:
a,b,c,x,y=map(int,input().split())
ans=float("inf")
for i in range(max(x,y)+1):
    t=a*max(0,x-i)+b*max(0,y-i)+2*c*i
    ans=min(ans,t)
print(ans)
Buggy code:
a, b, c, x, y = map(int, input().split())
ret = 0
if 2 * c <= a + b:
  m = min(x, y)
  ret += m * c
  x -= m
  y -= m
  ret += min(2 * c, a) * x
  ret += min(2 * c, b) * y
else:
  ret += a * x
  ret += b * y
print(ret)

Fixed code:
a, b, c, x, y = map(int, input().split())
ret = 0
if 2 * c <= a + b:
  m = min(x, y)
  ret += m * 2 * c
  x -= m
  y -= m
ret += min(2 * c, a) * x
ret += min(2 * c, b) * y
print(ret)
Buggy code:
import sys
a,b,c,x,y=map(int,input().split())
val=0
if a+b<=2*c:
  print(a*x+b*y)
  sys.exit()
else:
  val+=min(x,y)*c*2
  x-=min(x,y)
  y-=min(x,y)
  if x==0:
    val+=min(min(b*y,y*2*c),((y-1)*2*c)+b)
  if y==0:
    val+=min(min(a*x,x*2*c),((x-1)*2*c)+a)
  print(val)
  sys.exit()

Fixed code:
import sys
a,b,c,x,y=map(int,input().split())
val=0
if a+b<=2*c:
  print(a*x+b*y)
  sys.exit()
else:
  m=min(x,y)
  val+=m*c*2
  x=x-m
  y=y-m
  if x==0:
    if y==0:
      print(val)
      sys.exit()
    val+=min(b*y,y*2*c)
  if y==0:
    val+=min(a*x,x*2*c)
  print(val)
  sys.exit()
Buggy code:
a, b, c, x, y = map(int, input().split())

def f(x,y):
    return x-y if x>y else 0

if (a+b) > 2*c:
    ans = min(2*c*x + f(y,x)*b, 2*c*y + f(x,y)*a)
else:
    ans = 2*c*x + (y-a)*b

print(ans)    

Fixed code:
a, b, c, x, y = map(int, input().split())

def f(x,y):
    return x-y if x>y else 0

if (a+b) > 2*c:
    ans = min(2*c*x + f(y,x)*b, 2*c*y + f(x,y)*a)
else:
    ans = a*x + b*y

print(ans)
Buggy code:
a,b,c,x,y = map(int,input().split())

ans = 0
ans += min(x,y)*min(a+b,2*c)
if y > x:
  ans = (y-x)*min(b,c*2)
if x > y:
  ans += (x-y)*min(a,c*2)
print(ans)

Fixed code:
a,b,c,x,y = map(int,input().split())

ans = 0
ans += min(x,y)*min(a+b,2*c)
if y > x:
  ans += (y-x)*min(b,c*2)
if x > y:
  ans += (x-y)*min(a,c*2)
print(ans)
Buggy code:
A, B, C, X, Y = [int(x) for x in input().split(' ')]
if (A + B) / 2 > C:
  p = 10**6
  for i in range(min(X, Y), max(X, Y)+1):
    p = min(p, A * max(0, X-i) + B * max(0, Y-i) + C * i * 2)
  print(p)
else:
  print(A * X + B * Y)

Fixed code:
A, B, C, X, Y = [int(x) for x in input().split(' ')]
if (A + B) / 2 > C:
  p = 10**10
  for i in range(min(X, Y), max(X, Y)+1):
    p = min(p, A * max(0, X-i) + B * max(0, Y-i) + C * i * 2)
  print(p)
else:
  print(A * X + B * Y)
Buggy code:
a,b,c,x,y=map(int,input().split())
ans=float('inf')
for i in range(10**5):
    tmp=i*c*2+a*max(x-i,0)+b*max(y-i,0)
    ans=min(ans,tmp)
print(ans)

Fixed code:
a,b,c,x,y=map(int,input().split())
ans=float('inf')
for i in range(10**5+1):
    temp=i*2*c + max(0,x-i)*a +max(0,y-i)*b
    ans=min(ans,temp)
print(ans)
Buggy code:
A, B, C, X, Y = map(int, input().split())
C = 2*C
ans = float('inf')
for i in range(1, 10**5+1):
    ans = min(ans, C*i + A*max(0, X-i) + B*max(0, Y-i))
print(ans)


Fixed code:
A, B, C, X, Y = map(int, input().split())
ans = float('inf')
for i in range(0, 10**5+1):
    ans = min(ans, 2*C*i + A*max(0, X-i) + B*max(0, Y-i))
print(ans)
Buggy code:
a, b, c, x, y = map(int,input().split())
total = []

for i in range(1, max(x, y) + 1):
    c_price = i * 2 * c
    if x - i <= 0:
        a_price = 0
    else:
        a_price = (x - i) * a
    if y - i <= 0:
        b_price = 0
    else:
        b_price = (y - i) * b
    total.append(a_price + b_price + c_price)
print(min(total))


Fixed code:
a, b, c, x, y = map(int,input().split())
total = []

for i in range(0, max(x, y) + 1):
    c_price = i * 2 * c
    if x - i <= 0:
        a_price = 0
    else:
        a_price = (x - i) * a
    if y - i <= 0:
        b_price = 0
    else:
        b_price = (y - i) * b
    total.append(a_price + b_price + c_price)
print(min(total))
Buggy code:
A,B,C,X,Y = map(int,input().split())

plan1 = (A*X) + (B*Y)
plan2 = (C*2) * max(X,Y)
plan3 = (C*2) * X + B*(Y-X)
plan4 = (C*2) * Y + A*(Y-X)

if X <= Y:
  print(min(plan1,plan2,plan3))
else:
  print(min(plan1,plan2,plan4))

Fixed code:
A,B,C,X,Y = map(int,input().split())

plan1 = (A*X) + (B*Y)
plan2 = (C*2) * max(X,Y)
plan3 = (C*2) * X + B*(Y-X)
plan4 = (C*2) * Y + A*(X-Y)

if X <= Y:
  print(min(plan1,plan2,plan3))
else:
  print(min(plan1,plan2,plan4))
Buggy code:
import numpy as np
def f(s):
    a, b, c, x, y = map(int, s.split())
    Min = np.inf
    for use_c in range(max(x, y) * 2 + 1):
        price = use_c * c + max(0, x - use_c // 2) * a + max(0, y - use_c // 2) * b
        if price < Min:
            Min = price
    print(Min)


Fixed code:
import numpy as np
def f(a, b, c, x, y):
    Min = np.inf
    for use_c in range(max(x, y) * 2 + 1):
        price = use_c * c + max(0, x - use_c // 2) * a + max(0, y - use_c // 2) * b
        if price < Min:
            Min = price
    print(Min)

a, b, c, x, y = map(int, input().split())
f(a, b, c, x, y)
Buggy code:
#pattern1:Only A-pizza/B-pizza
#pattern2:Only C-pizza
#pattern2:C-pizza & A or B-pizza

a,b,c,x,y = map(int, input().split())

price1 = x*a + y*b
price2 = max(x, y)*2*c
if x<=y:
  price3 = x*2*c
  price3 += (y-x)*b
else:
  price3 = y*2*c
  price3 += (y-x)*a

print(min(price1, price2, price3))

Fixed code:
# pattern1:Only A-pizza/B-pizza
# pattern2:Only C-pizza
# pattern2:C-pizza & A or B-pizza

a, b, c, x, y = map(int, input().split())

price1 = x * a + y * b
price2 = max(x, y) * 2 * c
price3 = min(x, y) * 2 * c + a * (x - min(x, y)) + b * (y - (min(x, y)))
print(min(price1, price2, price3))
Buggy code:
import sys
import itertools
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B,C,X,Y = IL()

ans = 0
if C*2 < A+B:
  ans += C*2 * min(X, Y)
  if X < Y:
    num = (Y - X)*B
    num = min(num, (Y - X)*C*2)
  else:
    num += (X - Y)*A
    num = min(num, (X - Y)*C*2)
  ans += num
  print(ans)
else:
  print(A*X + B*Y)

Fixed code:
import sys
import itertools
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B,C,X,Y = IL()

ans = 0
if C*2 < A+B:
  ans += C*2 * min(X, Y)
  num = 0
  if X < Y:
    num = (Y - X)*B
    num = min(num, (Y - X)*C*2)
  else:
    num += (X - Y)*A
    num = min(num, (X - Y)*C*2)
  ans += num
  print(ans)
else:
  print(A*X + B*Y)
Buggy code:
A, B, C, X, Y = map(int, input().split())
total = 0
ans = 10**10

for i in range(2, max(X, Y)*2, 2):
  total = A*(X-(i/2)) + B*(Y-(i/2)) + C*i
  ans = min(ans, total)
  
print(int(ans))

Fixed code:
A, B, C, X, Y = map(int, input().split())
total = 0
ans = 10**10

for i in range(0, max(X, Y)*2+2, 2):
  total = A*(max(X-(i/2),0)) + B*(max(Y-(i/2),0)) + C*i
  # print(total)
  ans = min(ans, total)
  
print(int(ans))
Buggy code:
a, b, c, x, y = map(int,input().split())

if (a+b)//2 <= c　and x != 0 and y != 0:
    print(x*a + y*b)
    exit()
    
ans = 0

ans += min(x,y) * c * 2

if x >= y:
    ans += min((x-y)*a, (x-y)*2*c)
else:
    ans += min((y-x)*b, (y-x)*2*c)
    
print(ans)

Fixed code:
a, b, c, x, y = map(int,input().split())
 
if a+b <= c * 2:
    print(x*a + y*b)
    exit()
    
ans = 0
 
ans += min(x,y) * c * 2
 
if x >= y:
    ans += min((x-y)*a, (x-y)*2*c)
else:
    ans += min((y-x)*b, (y-x)*2*c)
    
print(ans)
Buggy code:
a, b, c, x, y = map(int,input().split())

ans = max(x,y)*2*c
s = max(x,y)

while True:
    tmp = 0
    tmp -= c*2
    s -= 1
    if x > s:
        tmp += a
    if y > s:
        tmp += b
    if tmp > 0:
        print(ans)
        exit()
    else:
        ans += tmp

Fixed code:
a, b, c, x, y = map(int,input().split())

ans = max(x,y)*2*c
s = max(x,y)

while s:
    tmp = 0
    tmp -= c*2
    s -= 1
    if x > s:
        tmp += a
    if y > s:
        tmp += b
    if tmp > 0:
        print(ans)
        exit()
    else:
        ans += tmp
        
print(ans)
Buggy code:
(a, b, c, wanted_a, wanted_b) = (int(tok) for tok in input().split())

res = wanted_a * a + wanted_b * b
for both in range(max(wanted_a, wanted_b) * 2):
  left_a = wanted_a - both // 2
  left_b = wanteD_b - both // 2
  cost = both * c + max(0, left_a) * a + max(0, left_b) * b
  res = min(res, cost)

print(res)

Fixed code:
(a, b, c, wanted_a, wanted_b) = (int(tok) for tok in input().split())

res = wanted_a * a + wanted_b * b
for both in range(max(wanted_a, wanted_b) * 2 + 1):
  left_a = wanted_a - both // 2
  left_b = wanted_b - both // 2
  cost = both * c + max(0, left_a) * a + max(0, left_b) * b
  res = min(res, cost)

print(res)
Buggy code:
a, b, c, x, y = [int(x) for x in input().split()]

ans1 = 2 * min(x, y) * c
if x >= y:
  ans1 += (x - y) * a
else:
  ans1 += (y - x) * b

ans2 = x * a + y * b
print(min(ans1,ans2))

Fixed code:
a, b, c, x, y = [int(x) for x in input().split()]

ans1 = 2 * min(x, y) * c
if x >= y:
  ans1 += (x - y) * a
else:
  ans1 += (y - x) * b

ans2 = x * a + y * b

ans3 = 2 * max(x, y) * c

print(min(ans1, ans2, ans3))
Buggy code:
A, B, C, X, Y = map(int, input().split())
ans = float('INF')
for i in range(0, 2*min(X, Y)+1, 2):
  ans = min(ans, int(A*max(0, X-i/2)+B*max(0, Y-i/2)+C*i))
print(ans)

Fixed code:
A, B, C, X, Y = map(int, input().split())
ans = float('INF')
for i in range(0, 2*max(X, Y)+1, 2):
  ans = min(ans, int(A*max(0, X-i/2)+B*max(0, Y-i/2)+C*i))
print(ans)
Buggy code:
line = input()
a, b, c, x, y = map(int, line.split(' '))

print(a, b, c, x, y)

if x < y:
    pizza = [(x, a), (y, b)]
else:
    pizza = [(y, b), (x, a)]

values = list()
values.append(c * 2 * pizza[0][0] + pizza[1][1] * pizza[1][0] - pizza[0][0])
values.append(c * 2 * pizza[1][0])
values.append(a * x + b * y)

print(min(values))


Fixed code:
line = input()
a, b, c, x, y = map(int, line.split(' '))

if x < y:
    pizza = [(x, a), (y, b)]
else:
    pizza = [(y, b), (x, a)]

values = list()
values.append(c * 2 * pizza[0][0] + pizza[1][1] * (pizza[1][0] - pizza[0][0]))
values.append(c * 2 * pizza[1][0])
values.append(a * x + b * y)

print(min(values))
Buggy code:
A,B,C,X,Y=map(int,input().split(' '))

price=0
if X>Y:    
  N_same=Y
  flag='A'
else:
  N_same=X
  flag='B'
  
if A+B >2*C:
  price+=2*C*N_same
else:
  price+=(A+B)*N_same

if flag=='A':
  if A*(X-Y)>2*C*(X-Y):
    price+=2*C*(X-Y)
  else:
    price+=A*(X-Y)
else:
  if B*(X-Y)>2*C*(X-Y):
    price+=2*C*(X-Y)
  else:
    price+=B*(X-Y)

print(price)


Fixed code:
A,B,C,X,Y=map(int,input().split(' '))

price=0
if X>Y:    
  N_same=Y
  flag='A'
else:
  N_same=X
  flag='B'
  
if A+B >2*C:
  price+=2*C*N_same
else:
  price+=(A+B)*N_same

if flag=='A':
  if A*(X-Y)>2*C*(X-Y):
    price+=2*C*(X-Y)
  else:
    price+=A*(X-Y)
else:
  if B*(Y-X)>2*C*(Y-X):
    price+=2*C*(Y-X)
  else:
    price+=B*(Y-X)

print(price)
Buggy code:
a, b, c, x, y = (map(int, input().split()))
candi = []
for i in range(100001):
    candi.append(c*i+max(0,(x-i//2))*a+max(0,(y-i//2))*b)
print(min(candi))


Fixed code:
a, b, c, x, y = (map(int, input().split()))
candi = []
for i in range(200001):
    candi.append((c*i)+max(0,(x-(i//2)))*a+max(0,(y-(i//2)))*b)
print(min(candi))
Buggy code:
a, b, c, x, y = map(int, input().split())
if a+b > 2*c:
    if(x > y):
        print(y * c * 2 + (x - y)*a)
    else:
        print(x * c * 2 + (y - x)*b)
else:
    print(x * a + y * b)


Fixed code:
a, b, c, x, y = map(int, input().split())
if a+b > 2*c:
    if(x > y):
        if(a > 2*c):
            print(x*2*c)
        else:
            print(y * c * 2 + (x - y)*a)
    else:
        if(b > 2*c):
            print(y*2*c)
        else:
            print(x * c * 2 + (y - x)*b)
else:
    print(x * a + y * b)
Buggy code:
A,B,C,X,Y = map(int,input().split())
if 2*C >= A + B:
    ans = A*X+B*Y
else:
    n_c = 2*min(X,Y)
    print(n_c)
    if X > Y:
        ans = min(n_c*C+A*(X-n_c/2),C*2*X)
    else:
        ans = min(n_c*C+B*(Y-n_c/2),C*2*Y)
print(int(ans))


Fixed code:
A,B,C,X,Y = map(int,input().split())
if 2*C >= A + B:
    ans = A*X+B*Y
else:
    n_c = 2*min(X,Y)
    #print(n_c)
    if X > Y:
        ans = min(n_c*C+A*(X-n_c/2),C*2*X)
    else:
        ans = min(n_c*C+B*(Y-n_c/2),C*2*Y)
print(int(ans))
Buggy code:
A,B,C,X,Y=map(int,input().split())

if A<=2*C amd B<=2*C:
    print(A*X+B*Y)
    
else:
    if X>=Y:
        print(min(A*(X-Y)+2*C*Y),2*C*X)
    else:
        print(B*(Y-X)+2*C*X,2*C*Y)

Fixed code:
A,B,C,X,Y=map(int,input().split())

if A+B<=2*C:
    print(A*X+B*Y)
    
else:
    if X>=Y:
        print(min(A*(X-Y)+C*Y*2,C*X*2))
    else:
        print(min(B*(Y-X)+C*X*2,C*Y*2))
Buggy code:
a,b,c,x,y = map(int,input().split())
fx = x
fy = y
fl = 0
val = int(0)
fmin = min(x,y)
if a>2*c:
  val += 2*c*x
  y = y - x
  x = 0
  fl += 1
if y<0:
  y=0
if b>2*c:
  if fl == 1:
    val += 2*c*y
    y = 0
  else:
    val += 2*c*y
    x = x - y
    y = 0 
if x<0:
  nx = 0
else:
  nx = x
if y<0:
  ny = 0
else:
  ny = y
if a+b>2*c:
  nnx = nx - min(nx,ny)
  nny = ny - min(nx,ny)
  val += 2*c*min(nx,ny)
print(val+a*nnx+b*nny)

Fixed code:
a,b,c,x,y = map(int,input().split())
fx = x
fy = y
fl = 0
val = int(0)
fmin = min(x,y)
if a>2*c:
  x = 0
  y = y - fx
  val += 2*c*fx
  fl += 1
if y < 0:
  y = 0
if b>2*c:
  if fl == 1:
    val += 2*c*y
    y = 0
  else:
    val += 2*c*y
    x = x -y
    y = 0 
if x < 0:
  x = 0
nx = x
ny = y
if a+b>2*c:
  x = x - min(nx,ny)
  y = y - min(nx,ny)
  val += 2*c*min(nx,ny)
print(val+a*x+b*y)
Buggy code:
da = list(map(int,input().split()))
oka = 0
p = 0
l = 0
if da[3] <= da[4]:
  oka = da[3]
  p = da[4]-da[3]
  l = 1
elif da[4] <= da[3]:
  oka = da[4] 
  p = da[3]-da[4]
  l = 0
if (da[0]*da[3] + da[1]*da[4]) >= (da[2]*oka*2 + da[l]*p):
  if da[3] <= da[4]:
    print(da[2]*da[3]*2 + da[1]*(da[4]-da[3]))
  else:
    print(da[2] * da[4]*2 + da[0]*(da[3]-da[4]))
else:
  print(da[0] * da[3] + da[1] * da[4])

Fixed code:
da = list(map(int,input().split()))
oka = 0
o = 0
p = 0
l = 0
k = 0
if da[3] <= da[4]:
  oka = da[3]
  o = da[4]
  p = da[4]-da[3]
  l = 1
  k = 0
elif da[4] <= da[3]:
  oka = da[4]
  o = da[3]
  p = da[3]-da[4]
  l = 0
  k = 1
if (da[0]*da[3] + da[1]*da[4]) >= (da[2]*o*2 + da[k]*p):
  if da[3] <= da[4]:
    print(da[2]*da[4]*2)
  else:
    print(da[2]*da[3]*2)
elif (da[0]*da[3] + da[1]*da[4]) >= (da[2]*oka*2 + da[l]*p):
  if da[3] <= da[4]:
    print(da[2]*da[3]*2 + da[1]*(da[4]-da[3]))
  else:
    print(da[2]*da[4]*2 + da[0]*(da[3]-da[4]))
else:
  print(da[0] * da[3] + da[1] * da[4])
Buggy code:
a,b,c,x,y=map(int,input().split())
if a+b<=c:
    print(a*x+b*y)
else:
    c*2*min(x,y)+min(max(a*min(x,y),b*min(x,y)),c*2*abs(x-y))

Fixed code:
a,b,c,x,y=map(int,input().split())
if a+b<=2*c:
    print(a*x+b*y)
else:
    print(c*2*min(x,y)+min(max(a*(x-y),b*(y-x)),c*2*abs(x-y)))
Buggy code:
a,b,c,x,y = map(int,input().split())
ans = 10**20
for i in range(min(x,y)*2+1):
    ans = min(ans,c*i+a*max(0,x-i//2)+b*max(0,y-i//2))

print(ans)

Fixed code:
a,b,c,x,y = map(int,input().split())
a = min(a,2*c)
b = min(b,2*c)
ans = 10**20
for i in range(min(x,y)*2+1):
    ans = min(ans,c*i+a*max(0,x-i//2)+b*max(0,y-i//2))

print(ans)
Buggy code:
a,b,c,x,y=map(int,input().split())

m=max(x,y)
ans=10**9+7
for e in range(m+1):
  ans=min(ans,2*e*c+a*max(0,x-e)+b*(0,y-e))
  
print(ans)

Fixed code:
a,b,c,x,y=map(int,input().split())

m=max(x,y)
ans=10**9+7
for e in range(m+1):
  ans=min(ans,2*e*c+a*max(0,x-e)+b*max(0,y-e))
  
print(ans)
Buggy code:
A, B, C, X, Y = map(int, input().split())

cost_temp = float('inf')
for i in range(min(X,Y)):
    cost = i * 2 * C + A * max(0, X-i) + B * max(0, Y-i)
    if cost < cost_temp:
        cost_temp = cost

print(cost_temp)

Fixed code:
A, B, C, X, Y = map(int, input().split())

cost_temp = float('inf')

for i in range(max(X,Y)+1):
    cost = i * 2 * C + A * max(0, X-i) + B * max(0, Y-i)
    if cost < cost_temp:
        cost_temp = cost

print(cost_temp)
Buggy code:
A, B, C, X, Y = map(int, input().split())
list = []

for i in range(100001):
    price = 2*C*i + A*max(0,X-i) + B*min(0,Y-i)
    list.append(price)

print(min(list))


Fixed code:
A, B, C, X, Y = map(int, input().split())
list = []

for i in range(100001):
    price = 2*C*i + A*max(0,X-i) + B*max(0,Y-i)
    list.append(price)

print(min(list))
Buggy code:
A,B,C,X,Y=[int(i) for i in input().split()]
if X>=Y:
    result=min(X,Y)*min(A+B,C*2)+(max(X,Y)-min(X,Y))*min(A,C)
else:
    result=min(X,Y)*min(A+B,C*2)+(max(X,Y)-min(X,Y))*min(B,C)
print(result)

Fixed code:
A,B,C,X,Y=[int(i) for i in input().split()]
if X>=Y:
    result=min(X,Y)*min(A+B,C*2)+(max(X,Y)-min(X,Y))*min(A,C*2)
else:
    result=min(X,Y)*min(A+B,C*2)+(max(X,Y)-min(X,Y))*min(B,C*2)
print(result)