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

sum_ab = a + b
double_c = c * 2
cheaper = sum_ab if sum_ab <= double_c else double_c
lesser = x if x < y else y
moreer = x if x >= y else y
base_cost = cheaper * lesser
additional = 0
if x - y > 0:
  additional = (x-y) * a
else:
  additional = (y-x) * b
total_p1 = base_cost + additional
total_p2 = moreer * double_c
print(base_cost, additional)
print(min(total_p1, total_p2))

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

sum_ab = a + b
double_c = c * 2
cheaper = sum_ab if sum_ab <= double_c else double_c
lesser = x if x < y else y
moreer = x if x >= y else y
base_cost = cheaper * lesser
additional = 0
if x - y > 0:
  additional = (x-y) * a
else:
  additional = (y-x) * b
total_p1 = base_cost + additional
total_p2 = moreer * double_c
print(min(total_p1, total_p2))
Buggy code:
a,b,c,x,y=map(int,input().split())
res1=a*x+b*y
if x>y:
    res2=c*2*y+a*(x-y)
else:
    res2=c*2*x+b*(y-x)
print(min(res1,res2))

Fixed code:
a,b,c,x,y=map(int,input().split())
res1=a*x+b*y
if x>y:
    res2=c*2*y+a*(x-y)
else:
    res2=c*2*x+b*(y-x)
res3=c*2*max(x,y)
print(min(res1,res2,res3))
Buggy code:
a,b,c,x,y = map(int, input().split())
mix_price = min(a+b,c*2)
if a > 2 * c:
  print(x * 2 * c + (y - x) * b)
elif b > 2 * c:
  print(y * 2 * c + (x - y) * a)
elif a + b > 2 * c and x > y:
  print(y * mix_price + (x - y) * a)
elif a + b > 2 * c and x < y:
  print(x * mix_price + (y - x) * b)
else:
  print(x * a + y * b)

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

if A + B <= 2*C:
    ans = A*X + B *Y
    
elif A+B > 2*C:
    ans += C*2*min(X, Y)
    
    if X > Y:
        if A >= 2*C:
            ans += 2*C
        else:
            ans += A
    
    elif X < Y:
        if B >= 2*C:
            ans += 2*C
        else:
            ans += B

print(ans)

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

if A + B <= 2 * C:
    ans = A * X + B * Y
elif A + B >= 2 * C:
    ans += min(X, Y) * (2 * C)
    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 = 100000000000000000000000000000000000000
for c in range (max(2*X,2**Y)):
  price = A*max(0,X-(0.5*c))+B*max(0,Y-(0.5*c))+C*c
  if price < ans:
    ans = price
print(int(ans))

Fixed code:
A,B,C,X,Y = map(int,input().split())
ans = 100000000000000000000000000000000000000
for c in range (0,100001):
  price = A*max(0,X-c)+B*max(0,Y-c)+C*2*c
  if price < ans:
    ans = price
print(int(ans))
Buggy code:
a,b,c,x,y = list(map(int, input().split()))

s1 = a*x + b*y
s2 = c*(max(x,y)*2)
if x>y:
    s3 = c*(y*2) + a*(x-y)
elif y>x:
    s3 = c*(x*2) + b*(y-x)
else: s3 = 10**10

print(s1,s2,s3)
print(min(s1,s2,s3))

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

s1 = a*x + b*y
s2 = c*(max(x,y)*2)
if x>y:
    s3 = c*(y*2) + a*(x-y)
elif y>x:
    s3 = c*(x*2) + b*(y-x)
else: s3 = 10**10

print(min(s1,s2,s3))
Buggy code:
a, b, c, x, y = map(int, input().split())
print(min(a*x+b*y, 2*c*x + b*max(0,y-x), 2*c*y + a*max(0, x-y))

Fixed code:
a, b, c, x, y = map(int, input().split())
print(min(a*x+b*y, 2*c*x + b*max(0,y-x), 2*c*y + a*max(0, x-y)))
Buggy code:
A, B, C, X, Y = map(int, input().split())
Sum = A * X + B * Y

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

print(Sum)

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

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

print(Sum)
Buggy code:
a,b,c,x,y = [int(i) for i in input().split()]
if a>2*c and b>2*c:
        m = max(x,y)*2*c
elif a>2*c:
        if x>=y:
            m = x*2*c
        else:
            m=x*2*c+(y-x)*b
elif b>2*c:
        if y>=x:
            m=y*2*c
        else:
            m=y*2*c +(x-y)*a
else:
    m = x*a + y*b
print(m)

Fixed code:
a,b,c,x,y = [int(i) for i in input().split()]
if a>2*c and b>2*c:
        m = max(x,y)*2*c
elif a>2*c:
        if x>=y:
            m = x*2*c
        else:
            m=x*2*c+(y-x)*b
elif b>2*c:
        if y>=x:
            m=y*2*c
        else:
            m=y*2*c +(x-y)*a
elif a+b>2*c:
    if x>=y:
        d=a
    else:
        d=b
    m = min(x,y)*2*c+(max(x,y)-min(x,y))*d
else:
    m = x*a + y*b
print(m)
Buggy code:
A,B,AB,X,Y= int(input.split())
ans = (X * A) + (Y * B)
max_ab_cnt = max(X,Y)
for ab_cnt in (max_ab_cnt+1):
    a_cnt = max(X - ab_cnt, 0)
    b_cnt = max(Y - ab_cnt,0)
    tmp = (a_cnt *A) + (ab_cnt * 2 * AB) + (b_cnt * B)
    ans = min(ans, tmp)
print(ans)

Fixed code:
A,B,AB,X,Y= list(map(int, input().split()))
ans = (X * A) + (Y * B)
max_ab_cnt = max(X,Y)
for ab_cnt in range(max_ab_cnt+1):
    a_cnt = max(X - ab_cnt, 0)
    b_cnt = max(Y - ab_cnt,0)
    tmp = (a_cnt *A) + (ab_cnt * 2 * AB) + (b_cnt * B)
    ans = min(ans, tmp)
print(ans)
Buggy code:
A, B, C, X, Y = map(int,input().split())
value = 0
ans = []
if X > 0 and Y > 0 and A + B > 2*C:
    m = min(X, Y)
    value += m * 2*C
    X = X - m
    Y = Y - m
value += (X * A + Y * B)
ans.append(value)
ans.append(max(X,Y) * 2*C)
print(min(ans))

Fixed code:
A, B, C, X, Y = map(int,input().split())
value = 0
ans = []
ans.append(max(X,Y) * 2*C)
if X > 0 and Y > 0 and A + B > 2*C:
    m = min(X, Y)
    value += m * 2*C
    X = X - m
    Y = Y - m
value += (X * A + Y * B)
ans.append(value)
print(min(ans))
Buggy code:
a,b,c,x,y = map(int, input().split())

ans = 0

if x<y:
    xy = x
    y -= x
    if b < 2*c:
        ans += b*y
    else:
        ans += 2*c*y
    print ("y")

else:
    xy = y
    x -= y
    if a < 2*c:
        ans += a*x
    else:
        ans += 2*c*x


if a+b<2*c:
    ans += xy*(a+b)
else:
    ans += xy*(2*c)

print (ans)


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

ans = 0

if x<y:
    xy = x
    y -= x
    if b < 2*c:
        ans += b*y
    else:
        ans += 2*c*y

else:
    xy = y
    x -= y
    if a < 2*c:
        ans += a*x
    else:
        ans += 2*c*x

if a+b<2*c:
    ans += xy*(a+b)
else:
    ans += xy*(2*c)

print (ans)
Buggy code:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
import random
J=998244353
from collections import deque
########################################################
a,b,c,x,y=INPUT()
#cost of 1 pi is a+b or 2*c
if 2*c<(x+y):
    cost=2*c*min(x,y)
    if x>y:
        r=x-y
        if 2*c>x:
            cost+=r*a
        else:
            cost+=r*(2*c)
        print(cost)
    else:
        r=y-x
        if 2*c>y:
            cost+=r*b
        else:
            cost+=r*(2*c)
        print(cost)
else:
    print(x*a+y*b)
    


Fixed code:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
import random
J=998244353
from collections import deque
########################################################
a,b,c,x,y=INPUT()
#cost of 1 pi is a+b or 2*c
if 2*c<(a+b):
    cost=2*c*min(x,y)
    if x>y:
        r=x-y
        if 2*c>a:
            cost+=r*a
        else:
            cost+=r*(2*c)
        print(cost)
    else:
        r=y-x
        if 2*c>b:
            cost+=r*b
        else:
            cost+=r*(2*c)
        print(cost)
else:
    print(x*a+y*b)
Buggy code:
A, B, C, X, Y = map(int, input().split())
value = float('inf')
D = max(A,B)
for i in range(D+1):
  valueX = 2*i*C+(X-i)*A+(Y-i)*B
  if valueX < value:
    value  = valueX
print(str(value))

Fixed code:
A, B, C, X, Y = map(int, input().split())
value = float('inf')
D = max(X,Y)
for i in range(D+1):
  E = max((X-i)*A, 0)
  F = max((Y-i)*B, 0)
  valueX = 2*i*C+E+F
  if valueX < value:
    value  = valueX
print(str(value))
Buggy code:
a,b,c,x,y=map(int,input().split())
sum=0
if a+b>=2*c:
  sum+=2*c*min(x,y)
  x-=min(x,y)
  y-=min(x,y)
  if x==0:
    if b>=2*c:
      sum+=2*c*y
    else:
      sum+=b*y
  elif y==0:
    if a>=2*c:
      sum+=2*c*x
    else:
      sum+=a*x
else:
  sum+=a*x+b*y
print(sum)

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

Fixed code:
A,B,C,X,Y = map(int,input().split())
sum = 0
if A+B > C*2:
    if X > Y:
        sum = Y*2*C
        X = X-Y
        Y = 0
    else :
        sum = X*2*C
        Y = Y-X
        X = 0
if C*2 < A:
    sum = sum + X*2*C
    X = 0
if C*2 < B:
    sum = sum + Y*2*C
    Y = 0
sum = sum + X*A + Y*B
print(sum)
Buggy code:
    a, b, c, x, y = list(map(int, input().split()))
    res = a * x + b * y
    for i in range(1, max(x, y) + 1):
        res = min(res, a * max(x - i, 0) + b * max(y - i, 0) + 2 * c * i)
    print(res)

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

c = min(A + B, C * 2)
a = min(c, A)
b = min(c, B)

xy = min(X, Y)

print (xy * c + (X - xy) * A + (Y - xy) * B)

Fixed code:
A, B, C, X, Y = map(int, input().split())
 
c = min(A + B, C * 2)
a = min(c, A)
b = min(c, B)
 
xy = min(X, Y)
 
print (xy * c + (X - xy) * a + (Y - xy) * b)
Buggy code:
a, b, c, x, y = map(int, input().split())
ans = float("inf")
for i in range(max(x, y)):
    ans = min(ans, i * 2 * c + 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(100001):
    ans = min(ans, i * 2 * c + a * max(0, x - i) + b * max(0, y - i))
print(ans)
Buggy code:


A,B,C,X,Y = input().split(' ')

#print(A,B,C,X,Y)

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

print(ans)

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

#print(A,B,C,X,Y)

ans = 10 ** 12
for i in range(0,100001):
  tmp = int(C) * 2 * i + int(A) * max(int(X)-i,0) + int(B) * max(int(Y)-i,0)
  ans = min(ans,tmp)

print(ans)
Buggy code:
a,b,c,x,y = map(int,input().split())
print( min(x,y)*min(a+b,2*c) + (max(x,y)-min(x,y))*(max(x,y)==y)*b + (max(x,y)-min(x,y))*(max(x,y)==a)*a)

Fixed code:
a, b, c, x, y = map(int, input().split())
print(min([a*x+b*y, a*(x-min([x,y]))+b*(y-min([x,y]))+2*c*min([x,y]),2*c*max([x, y])]))
Buggy code:
a,b,c,x,y = map(int, input().split())
only = a * x + b * y 
ans = only
for i in range(1,x + 1):
    current = 0
    current = c * i * 2
    if y - i >= 0:
        current = current + a * ( x - i ) + b * (y - i)
    else:
        current = current + a * ( x - i )
    if ans > current:
        ans = currents
for i in range(1,y + 1):
    current = 0
    current = c * i * 2
    if x - i >= 0:
        current = current + a * ( x - i ) + b * ( y - i )
    else:
        current = current + b * ( y - i )
    if ans > current:
        ans = current
print(ans)

Fixed code:
a,b,c,x,y = map(int, input().split())
only = a * x + b * y 
ans = only
for i in range(1,x + 1):
    current = 0
    current = c * i * 2
    if y - i >= 0:
        current = current + a * ( x - i ) + b * (y - i)
    else:
        current = current + a * ( x - i )
    if ans > current:
        ans = current
for i in range(1,y + 1):
    current = 0
    current = c * i * 2
    if x - i >= 0:
        current = current + a * ( x - i ) + b * ( y - i )
    else:
        current = current + b * ( y - i )
    if ans > current:
        ans = current
print(ans)
Buggy code:

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

if a + b < c * 2:
    p = a * x + b * y
else:
    if x > y:
        x -= y
        z = y * 2
        y = 0
        if a > c * 2:
            z += x * 2

    else:
        y -= x
        z = x * 2
        x = 0
        if b > c * 2:
            z += 0

print(x * a + y * b + z * c)


Fixed code:

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

if a + b < c * 2:
    p = a * x + b * y
else:
    if x > y:
        x -= y
        z = y * 2
        y = 0
        if a > c * 2:
            z += x * 2
            x = 0

    else:
        y -= x
        z = x * 2
        x = 0
        if b > c * 2:
            z += y * 2
            y = 0

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

ans = min(a*x+b*y, c*max(x,y)*2, c*x*2+max(0,(y-x)*b), c*y*2+max((x-y)*a)*a)

print(ans)

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

ans = min(a*x+b*y, c*max(x,y)*2, c*x*2+max(0,(y-x)*b), c*y*2+max(0,(x-y)*a))

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

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

AB = A + B

num_A = 0
num_B = 0
num_C = 0
ans_cost = 5000 * 2 * 10**5
if 2 * C > AB:
    num_A = X
    num_B = Y
    num_C = 0
    ans_cost = int(A*num_A + B*num_B + C*num_C)
else:
    min_C = min(X,Y) *2
    max_C = max(X,Y) *2
    for i in range(min_C, max_C+1, 2):
        num_A = X - i / 2
        num_B = Y - i / 2
        if num_A < 1:
            num_A = 0
        if num_B < 1:
            num_B = 0
        
        total_cost = int(A*num_A + B*num_B + C*i)
    
        if total_cost < ans_cost:
            ans_cost = total_cost



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

AB = A + B

num_A = 0
num_B = 0
num_C = 0
ans_cost = 5000 * 2 * 10**5
if 2 * C > AB:
    num_A = X
    num_B = Y
    num_C = 0
    ans_cost = int(A*num_A + B*num_B + C*num_C)
else:
    min_C = min(X,Y) *2
    max_C = max(X,Y) *2
    for i in range(min_C, max_C+1, 2):
        num_A = X - i / 2
        num_B = Y - i / 2
        if num_A < 1:
            num_A = 0
        if num_B < 1:
            num_B = 0
        
        total_cost = int(A*num_A + B*num_B + C*i)
    
        if total_cost < ans_cost:
            ans_cost = total_cost

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

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

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

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

ans1 = A*X + B*Y
ans2 = 0
ans3 = 0
if X >= Y:
  ans2 = A*(X-Y) + AB*Y
  ans3 = AB*X
else:
  ans2 = A*(Y-X) + AB*X
  ans3 = AB*Y
print(min(ans1, ans2, ans3))

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

ans1 = A*X + B*Y
ans2 = 0
ans3 = 0
if X >= Y:
  ans2 = A*(X-Y) + AB*Y*2
  ans3 = AB*X*2
else:
  ans2 = B*(Y-X) + AB*X*2
  ans3 = AB*Y*2
print(min(ans1, ans2, ans3))
Buggy code:
A,B,C,X,Y=map(int,input().split())

A=10**9
for i in range(0,10**5+1):
    S=i*2*C+max(0,X-i)*A+max(0,Y-i)*B
    A=min(A,S)
print(A)

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

K=10**9
for i in range(10**5+1):
    S=i*2*C+max(0,X-i)*A+max(0,Y-i)*B
    K=min(K,S)
print(K)
Buggy code:
#ABC095-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
a,b,c,x,y=IL()
if c<=a:
    if c<=b:
        print(c*max(x,y))
    else:
        print(c*x+max(0,(y-x)*b))
elif c<=b:
    print(c*y+max(0,(x-y)*a))
if a+b<=c:
    if x>=y:
        print(c*y+a*(x-y))
    else:
        print(c*x+b*(y-x))

Fixed code:
#ABC095-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
a,b,c,x,y=IL()
c=c*2
if c<=a:
    if c<=b:
        print(c*max(x,y))
    else:
        print(c*x+max(0,(y-x)*b))
elif c<=b:
    print(c*y+max(0,(x-y)*a))
elif c<=a+b:
    if x>=y:
        print(c*y+a*(x-y))
    else:
        print(c*x+b*(y-x))
else:
    print(a*x+b*y)
Buggy code:
A, B, C, X, Y = map(int, input().split())

ans = 10 ** 9
for i in range(0,max(X,Y)*2,2):
  p = i * C + A * max(X - i // 2, 0) + B * max(Y - i // 2, 0)
#  print (i,max(X - i // 2, 0),max(Y - i // 2, 0),p,ans)
  ans = min(ans, p)
print (ans)

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

ans = 10 ** 9
for i in range(0,max(X,Y)*2+1,2):
  p = i * C + A * max(X - i // 2, 0) + B * max(Y - i // 2, 0)
#  print (i,max(X - i // 2, 0),max(Y - i // 2, 0),p,ans)
  ans = min(ans, p)
print (ans)
Buggy code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

a,b,c,x,y = I()
p = []
for i in range(10**5+1):
    cash = 2*c*i+a*max(0,x-i)+B*max(0,y-i)
    c.append(cash)

print(min(p))


Fixed code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

a,b,c,x,y = I()
p = []
for i in range(10**5+1):
    cash = 2*c*i+a*max(0,x-i)+b*max(0,y-i)
    p.append(cash)

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

ans = 10**7
for i in range(max(X, Y) * 2 + 1):
    c = i
    a = X - i // 2
    if a < 0:
        a = 0
    b = Y - i // 2
    if b < 0:
        b = 0
    v = a * A + b * B + c * C
    if v < ans:
        ans = v

print(ans)


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

ans = 10**20
for i in range(max(X, Y) * 2 + 1):
    c = i
    a = X - i // 2
    if a < 0:
        a = 0
    b = Y - i // 2
    if b < 0:
        b = 0
    v = a * A + b * B + c * C
    if v < ans:
        ans = v

print(ans)
Buggy code:
a,b,c,x,y=map(int,input().split())
ans=float('inf')
for i in range(1,max(x,y)+1):
    s=i*2*c+max(x-i,0)*a+max(y-i,0)*b
    ans=min(s,ans)
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):
    s=i*2*c+max(x-i,0)*a+max(y-i,0)*b
    ans=min(s,ans)
print(ans)
Buggy code:
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 a_count > -1 and b_count > -1:
    if kouhopiza > a_yen * a_count + b_yen * b_count + c_yen * c_count:
        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
print(kouhopiza)

Fixed code:
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 code:
A,B,C,X,Y=map(int,input().split())
ans=5000*(10**5)+1

for i in range(max(X,Y)):
  total=0
  total=2*C*i+A*max(X-i,0)+B*max(Y-i,0)
  if ans>=total:
    ans=total
print(ans)

Fixed code:
A,B,C,X,Y=map(int,input().split())
ans=5000*(10**5)*2+1

for i in range(max(X,Y)+1):
  total=0
  total=2*C*i+A*max(X-i,0)+B*max(Y-i,0)
  if ans>=total:
    ans=total
print(ans)
Buggy code:
A,B,C,X,Y=map(int,input().split())
M=[A,B,C]

ans=[]

ans.append(A*X+B*Y)
ans.append(C*max(X,Y)*2)

if A>B:
  ans.append(C*min(X,Y)*2+A*(X-min(X,Y)))
if B>A:  
  ans.append(C*min(X,Y)*2+B*(Y-min(X,Y)))

print(min(ans))

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

ans=[]

ans.append(A*X+B*Y)
ans.append(C*max(X,Y)*2)

if X>Y:
  ans.append(C*min(X,Y)*2+A*(X-min(X,Y)))
if Y>X:  
  ans.append(C*min(X,Y)*2+B*(Y-min(X,Y)))

print(min(ans))
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 11:16:07 2020

@author: liang
"""

A, B, C, X, Y = map(int,input().split())
if A + B > 2*C:
    if X > Y :
        ans = Y * C * 2 + abs(X-Y) * A
    else:
        ans = X * C * 2 + abs(X-Y) * B
else:
    ans = X * A + Y * B 
print(ans)

Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 11:16:07 2020

@author: liang
"""

A, B, C, X, Y = map(int,input().split())
if A + B > 2*C:
    if X > Y :
        if A < 2 * C:
            ans = Y * C * 2 + abs(X-Y) * A
        else:
            ans = X * C * 2
    else:
        if B < 2 * C:
            ans = X * C * 2 + abs(X-Y) * B
        else:
            ans = Y * C * 2
else:
    ans = X * A + Y * B 
print(ans)
Buggy code:
a, b, c, x, y = list(map(int, input().split()))
n = [0, 0, 0]
n[0] = a*x+b*y
if x<=y:
    n[1] = 2*c*x+b*(y-x)
else:
    n[1] = 2*c*x+a*(x-y)
n[2] = 2*c*max(x, y)
print(min(n))

Fixed code:
a, b, c, x, y = list(map(int, input().split()))
n = [0, 0, 0]
n[0] = a*x+b*y
if x<=y:
    n[1] = 2*c*x+b*(y-x)
else:
    n[1] = 2*c*y+a*(x-y)
n[2] = 2*c*max(x, y)
print(min(n))
Buggy code:
a,b,c,x,y = map(int,input().split())

piza_min = min(x,y)

plan1 = c*piza_min*2 + a*(x-piza_min) + b*(y-piza_min)
plan2 = a*x + b*y

print(min(plan1,plan2))

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

piza_min = min(x,y)

plan1 = c*piza_min*2 + a*(x-piza_min) + b*(y-piza_min)
plan2 = a*x + b*y
plan3 = c*max(x,y)*2

print(min(plan1,plan2,plan3))
Buggy code:
A,B,C,X,Y = map(int, input().split())

min = float('inf')
for k in range(10**5):
    temp = 2*C*k+max(X-k,0)*A+max(Y-k,0)*B

    if min > temp:
        min = temp
print(min)

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

min = float('inf')
for k in range(10**5+1):
    temp = 2*C*k+max(X-k,0)*A+max(Y-k,0)*B

    if min > temp:
        min = temp
print(min)
Buggy code:
A,B,C,X,Y = map(int, input().split())

n = min(X,Y)

sum = 0

sum = min(n*2*C, A*n+B*n)

if X>Y:
    n = X-n
    sum = sum + n*A
else:
    n = Y - n
    sum = sum + n*B

sum_ab = X*A + Y*B

sum_a_b = 2*(X+Y)*C


print(min(sum,sum_ab,sum_a_b))

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

n = min(X,Y)

sum = 0

sum = min(n*2*C, A*n+B*n)

if X>Y:
    n = X-n
    sum = sum + n*A
else:
    n = Y - n
    sum = sum + n*B

sum_ab = X*A + Y*B

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


print(min(sum,sum_ab,sum_a_b))