qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a, b, c, x, y = map(int, input().split())
if a + b < 2 * c:
  print(a * x + b * y)
else:
  if x > y:
    if a < 2 * c:
      print(c * 2 * y + a * (x-y))
    else:
      print(c * 2 * y + c * (x-y))
  else:
    if b < 2 * c:
      print(c * 2 * x + b * (y-x))
    else:
      print(c * 2 * x + c * (x-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:
    if a < 2 * c:
      print(c * 2 * y + a * (x-y))
    else:
      print(c * 2 * y + c * 2 * (x-y))
  else:
    if b < 2 * c:
      print(c * 2 * x + b * (y-x))
    else:
      print(c * 2 * x + c * 2 * (y-x))
Buggy code:
a,b,c,x,y = map(int,input().split())
cnt = 0
if 2*c < a+b:
    cnt += abs(x-y)*c*2
    if x > y:
        c += (x-y)*a
    else:
        c += (y-x)*b
else:
    cnt += a*x + b*y
print(cnt)

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

Fixed code:
A,B,C,X,Y=map(int,input().split())
if A+B>2*C:
  if X>=Y:
    print(min(C*X*2,Y*2*C+((X-Y)*A)))
  else:
    print(min(C*Y*2,X*2*C+((Y-X)*B)))
else:
  print(A*X+B*Y)
Buggy code:
A,B,C,X,Y = (int(i) for i in input().split())
i = 0
a = []
while i <= 10:
    p = i * 2*C + A*max(0,X-i)+B*max(0,Y-i)
    a.append(p)
    i += 1
print(min(a))

Fixed code:
A,B,C,X,Y = (int(i) for i in input().split())
i = 0
a = []
while i <= 100000:
    p = i * 2*C + A*max(0,X-i)+B*max(0,Y-i)
    a.append(p)
    i += 1
print(min(a))
Buggy code:
A, B, C, X, Y = list(map(int, input().split()))
if(A + B <= 2*C):
    a, b = X, Y
else:
    c = min(X, Y) * 2
    if(X > Y):
        if(A > 2*C):
            c += (X - Y) * 2
        else:
            a = (X - Y)
    else:
        if(B > 2*C):
            c += (Y - X) * 2
        else:
            b = (Y - X)


price = a*A + b*B + c*C
print(price)



Fixed code:
A, B, C, X, Y = list(map(int, input().split()))
a, b, c = 0, 0, 0
if(A + B <= 2*C):
    a, b = X, Y
else:
    c = min(X, Y) * 2
    if(X > Y):
        if(A > 2*C):
            c += (X - Y) * 2
        else:
            a = (X - Y)
    else:
        if(B > 2*C):
            c += (Y - X) * 2
        else:
            b = (Y - X)


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

Fixed code:
a,b,c,x,y=map(int,input().split())
c=min(c*2,a+b)
ans=min(x,y)*c
if x>y:ans+=min(a,c)*(x-y)
else:ans+=min(b,c)*(y-x)
print(ans)
Buggy code:
a, b, c, x, y = [int(elem) for elem in input().split()]

res = -1
for i in range(0, 10 ** 5):
  cand = i * 2 * c + max(0, x - i) * a + max(0, y - i) * b
  if res == -1:
    res = cand
  else:
    if res > cand:
      res = cand
print(res)

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

res = -1
for i in range(0, 10 ** 5 + 1):
  cand = i * 2 * c + max(0, x - i) * a + max(0, y - i) * b
  if res == -1:
    res = cand
  else:
    if res > cand:
      res = cand
print(res)
Buggy code:
a,b,c,x,y = list(map(int, input().split()))

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

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




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

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

    else :
        if b >= 2*c:
            print(x*2*c + (y-x)*2*c)
        else:
            print(x*2*c + (y-x)*b)
Buggy code:
a,b,c,x,y = list(map(int,input().split()))
for i in range(100000):
    price_new = i*2*c + max(0, x-i)*a + max(0, y-i)*b
    if i==0:
        price = price_new
    else:
        price = min(price, price_new)

print(price)

Fixed code:
a,b,c,x,y = list(map(int,input().split()))
for i in range(100001):
    price_new = i*2*c + max(0, x-i)*a + max(0, y-i)*b
    if i==0:
        price = price_new
    else:
        price = min(price, price_new)

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

if x>y:
    print(min(x,y)*cheap+(x-y)*a)
elif x<y:
    print(min(x,y)*cheap+(y-x)*b)
else:
    print(min(x,y)*cheap)

Fixed code:
a,b,c,x,y = map(int,input().split())
cheap = min(a+b,c*2)

if x>y:
    result = min(x,y)*cheap+(x-y)*a
elif x<y:
    result = min(x,y)*cheap+(y-x)*b
else:
    result = min(x,y)*cheap
    
print(min(result,c*max(x,y)*2))
Buggy code:
a, b, c, x, y = map(int, input().split())
ans = 1000000000000
for i in range(50000):
  ans = min(2 * c * i + max(0, x-i) * a + max(0, y-i) * b, ans)
print(ans)

Fixed code:
a, b, c, x, y = map(int, input().split())
ans = 1000000000000
for i in range(100001):
  ans = min(2 * c * i + max(0, x-i) * a + max(0, y-i) * b, ans)
print(ans)
Buggy code:
a,b,c,x,y = map(int,input().split())
p = max(x,y)
q = min(x,y)
ans = 0
if a+b>=2*c:
    if p == x:
        ans += 2*c*q + min(a,2*c)*(p-q)
    else:
        ans += 2*c*q + min(b,2*c)*(p-q)
else:
    if p == x:
        ans += (a+b)*q + min(a,2*c)*(p-q)
    else:
        ans += (a+b)*q + min(b,2*c)*(p-q)
         
print(ans)
print(a,b,c,x,y)

Fixed code:
a,b,c,x,y = map(int,input().split())
p = max(x,y)
q = min(x,y)
ans = 0
if a+b>=2*c:
    if p == x:
        ans += 2*c*q + min(a,2*c)*(p-q)
    else:
        ans += 2*c*q + min(b,2*c)*(p-q)
else:
    if p == x:
        ans += (a+b)*q + min(a,2*c)*(p-q)
    else:
        ans += (a+b)*q + min(b,2*c)*(p-q)
         
print(ans)
# print(a,b,c,x,y)
Buggy code:
a,b,c,x,y=map(int,input().split())
ans=a*x+b*y
for ab in range(1,max(a,b)):
    if 2*ab*c+a*(max(x-ab,0))+b*(max(0,y-ab))<ans:
        ans=2*ab*c+a*(max(x-ab,0))+b*(max(0,y-ab))
print(ans)

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

ans = float('inf')
for i in range(max(x,y)):
    tmp = c*2*i + max(0, x-i) * a + max(0, y-i) * b
    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):
    tmp = c*2*i + max(0, x-i) * a + max(0, y-i) * b
    ans = min(ans, tmp)

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

print(mix(X, Y) * 2 * C + (A if X > Y else B) * abs(X-Y), A * X + B * Y, max(X, Y) * 2 * C)

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

print(min(min(X, Y) * 2 * C + (A if X > Y else B) * abs(X-Y), A * X + B * Y, max(X, Y) * 2 * C))
Buggy code:
a,b,c,x,y=map(int,input().split())
abget=min(a+b,2*c)
aget=min(a,2*c)
bget=min(b,2*c)
xyget=min(x,y)
ans=xyget*abget
if x>y:
  ans+=(x-xyget)*min(aget,abget)
elif y<x:
  ans+=(y-xyget)*min(bget,abget)
print(ans)

Fixed code:
a,b,c,x,y=map(int,input().split())
abget=min(a+b,2*c)
aget=min(a,2*c)
bget=min(b,2*c)
xyget=min(x,y)
ans=xyget*abget
if x>y:
  ans+=(x-xyget)*aget
elif y>x:
  ans+=(y-xyget)*bget
print(ans)
Buggy code:
a , b , c , x , y = map(int,input().split())
ans = 10*10

for i in range(10*8):
    ans = min(ans, a * max(x -i,0) + b * max ( y - i , 0 ) + (2 * c * i)  )

print(ans)

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

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

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

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


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

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

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

d = abs(x - y)
price = 0
num = 0
if x > y:
    price += d * a
    num = y
else:
    price += d * b
    num = x

if (a+b) >= 2*c:
    price += 2 * c * num
else:
    price += (a+b) * num

print(price)

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

d = abs(x - y)
price = 0
num = 0
if x > y:
    if a <= 2 * c:
        price += d * a
        num = y
    else:
        price += d * 2 * c
        num = y
else:
    if b <= 2 * c:
        price += d * b
        num = x
    else:
        price += d * 2 * c
        num = x



if (a+b) >= 2*c:
    price += 2 * c * num
else:
    price += (a+b) * num

print(price)
Buggy code:
a, b, c, x, y = map(int, input().split())
l = []

for i in range(x+y):
    if i%2!=0:
        continue
    if (i//2)>=x:
        a_p = 0
        b_p = b*(y-(i//2))
    if (i//2)>=y:
        a_p = a*(x-(i//2))
        b_p = 0
    else:
        a_p = a*(x-(i//2))
        b_p = b*(y-(i//2))
        
    price = (c*i)+ a_p + b_p
    l.append(price)

print(min(l))

Fixed code:
a, b, c, x, y = map(int, input().split())
l = []
kari = [x, y]
kari = max(kari)*2

for i in range(kari+1):
    if i%2!=0:
        continue

    a_p = a*(x-(i//2))
    b_p = b*(y-(i//2))
    if (i//2)>=x:
        a_p = 0
    if (i//2)>=y:
        b_p = 0
        
    price = (c*i)+ a_p + b_p
    l.append(price)


print(min(l))
Buggy code:
A, B, C, X, Y = map(int, input().split())
print(min(A * X + B * Y, 2 * C * min(X, Y) + A * max(0, X - Y) + B * max(0, Y - X)))


Fixed code:
A, B, C, X, Y = map(int, input().split())
print(
    min(
        2 * C * max(X, Y),
        min(A * X + B * Y, 2 * C * min(X, Y) + A * max(0, X - Y) + B * max(0, Y - X)),
    )
)
Buggy code:
a,b,c,x,y=map(int,input().split())
lo=0 
hi=10**19
def check(mi): 
    if a<c and b<c: 
        cost=a*x+b*y 
        #print('hf')
        return cost<=mi 
    if a>c and b>c:
        cost=0 
        mini=min(x,y)
        #print('hsdfiu')
        return mini*c*2+(-mini+x)*a+(-mini+y)*b<=mi 
    m=max(a,b)
    if m*2*c<=mi:
        #print('sdfu')
        return 1 
    if a*x+b*y<=mi:
        return 1 
    mini=min(x,y)
    if mini*c*2+(x-mini)*a+(y-mini)*b<=mi:
        print('sf')
        return 1 
    return 0 
#print(check(1700))
#print(check(4700))

while lo<=hi:
    mi=(lo+hi)>>1 
    if check(mi):
        ans=mi 
        hi=mi-1 
    else:
        lo=mi+1 
print(ans)

Fixed code:
a,b,c,x,y=map(int,input().split())
lo=0 
hi=10**19
def check(mi): 
    m=max(x,y)
    if m*2*c<=mi:
        #print('sdfu')
        return 1 
    if a<c and b<c: 
        cost=a*x+b*y 
        #print('hf')
        return cost<=mi 
    if a>c and b>c:
        cost=0 
        mini=min(x,y)
        #print('hsdfiu')
        return mini*c*2+(-mini+x)*a+(-mini+y)*b<=mi 

    if a*x+b*y<=mi:
        return 1 
    mini=min(x,y)
    if mini*c*2+(x-mini)*a+(y-mini)*b<=mi:
      #  print('sf')
        return 1 
    return 0 
#print(check(1700))
#print(check(4700))
#print(check(100000000))
while lo<=hi:
    mi=(lo+hi)>>1 
    if check(mi):
        ans=mi 
        hi=mi-1 
    else:
        lo=mi+1 
print(ans)
Buggy code:
A,B,C,X,Y = (int(i) for i in input().split())

if X>=Y:
    bigger = A
else:
    bigger = B


common = max(X,Y) - abs(X-Y)
if (A+B)/2 < C:
    total = A*common + B*common
else:
    total = C*common*2

difference = abs(X-Y)
if bigger < C*2:
    total = total + bigger*difference
else:
    total = total + bigger*C*2


print(total)

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

if X>=Y:
    bigger = A
else:
    bigger = B


common = max(X,Y) - abs(X-Y)
if (A+B)/2 < C:
    total = A*common + B*common
else:
    total = C*common*2

difference = abs(X-Y)
if bigger < C*2:
    total = total + bigger*difference
else:
    total = total + difference*C*2


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

mast = max(x,y)
ans =  c *2 *i

for i in range(mast+1):
    price = a * max(x-i,0) + b * max(y-i,0) + c *2 *i
    ans =min(ans,price) 
    
print(ans)

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

mast = max(x,y)
ans = float('INF')

for i in range(mast+1):
    price = a * max(x-i,0) + b * max(y-i,0) + c *2 *i
    ans =min(ans,price) 
    
print(ans)
Buggy code:
a,b,c,x,y=map(int,input().split())
d=(a+b)/2
import sys
o=x
w=y
count=0
if d>=c:
    if x>=y:
        r=x
        
        x-=y
        y=0
        count+=((r-x)*2*c)
        count+=(x*a)
        print(min(count,(o*2*c)))
        sys.exit()
      

    else:
        r=y
        
        y-=x
        x=0
        count+=((r-y)*2*c)
        count+=(x*a)
        print(min(count,y*2*c))
        sys.exit()
    
        
else:
    count+=a*x+b*y    
    print(count)

    


Fixed code:

    
a,b,c,x,y=map(int,input().split())
d=(a+b)/2
import sys
o=x
w=y
count=0
if d>=c:
    if x>=y:
        r=x
        
        x-=y
        
        count+=(y*2*c)
        count+=((r-y)*a)
        print(min(count,o*2*c))
        sys.exit()
      

    else:
        r=y
        
        y-=x
        
        count+=(x*2*c)
  
        count+=((r-x)*b)
        
        
        print(min(count,w*2*c))
        sys.exit()
    
        
else:
    count+=(a*x+b*y)    
    print(count)
Buggy code:
a,b,c,x,y = map(int,input().split())

chp = min(a+b,c*2)
memo1 = min(x,y)
memo2 = max(x,y)-min(x,y)
if x>y:
    print(memo2*a+memo1*chp)
else:
    print(memo2*b+memo1*chp)

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

chp = min(a+b,c*2)
memo1 = min(x,y)
memo2 = max(x,y)-min(x,y)
if x>y:
    a = min(a,c*2)
    print(memo2*a+memo1*chp)
else:
    b = min(b,c*2)
    print(memo2*b+memo1*chp)
Buggy code:
a,b,c,x,y=map(int,input().split())
if a+b<=2*c: print(a*x+b*y)
else:
    ans=min(x,y)*2*c
    print(ans)
    dif=abs(x-y)
    if x>y:
        if a>=2*c:
            ans+=2*dif*c
        else:
            ans+=a*dif
    else:
        if b>=2*c:
            ans+=2*dif*c
        else:
            ans+=b*dif
    print(ans)

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

Fixed code:
a, b, c, x, y = map(int, input().split())
ans = x*a+y*b
for i in range(max(x, y) + 1):
    p = c * i * 2 + max(0, x - i) * a + max(0, y - i) * b
    ans = min(ans, p)
print(ans)
Buggy code:
a,b,c,x,y = map(int,input().split())
min = x if x<y else y
price=0
if a+b > 2*c:
    price = min*2*c
    print(price)
    if a < c*2 and y<x:
        price+=a*(x-y)
    elif b<c*2 and x<y:
        price+=b*(y-x)
    else:
        diff = y-x if x<y else x-y
        price+=2*c*(diff)
else:
    price = a*x+b*y
print(price)

Fixed code:
a,b,c,x,y = map(int,input().split())
min = x if x<y else y
price=0
if a+b > 2*c:
    price = min*2*c
    if a < c*2 and y<x:
        price+=a*(x-y)
    elif b<c*2 and x<y:
        price+=b*(y-x)
    else:
        diff = y-x if x<y else x-y
        price+=2*c*(diff)
else:
    price = a*x+b*y
print(price)
Buggy code:
l = list(input().split())
c = 0
for i in l:
 l[c] = int(l)
 c += 1

k = min(l[3],l[4])
money = min((l[0]+l[1])*k, l[2]*2*k)

if l[3]>l[4]:
 m = l[3]-l[4]
 money += min(l[0], l[2]*2)*m
else:
 m = l[4]-l[3]
 money += min(l[1], l[2]*2)*m

print(money)




 

Fixed code:
l = list(input().split())
c = 0
for i in l:
 l[c] = int(i)
 c+=1

k = min(l[3],l[4])
money = min((l[0]+l[1])*k, l[2]*2*k)

if l[3]>l[4]:
 m = l[3]-l[4]
 money += min(l[0], l[2]*2)*m
else:
 m = l[4]-l[3]
 money += min(l[1], l[2]*2)*m

print(money)
Buggy code:
A,B,C,X,Y=map(int,input().split())
price=0
if A+B>C+C:
    minXY=min(X,Y)
    price+=minXY*C*2
    X-=minXY
    Y-=minXY
if A>C+C:
    price=X*2*C
    X=0
else:
    price+=A*X
    X=0
if B>C+C:
    price=Y*2*C
    Y=0
else:
    price+=B*Y
    Y=0
print(price)

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

ans = float("inf")
for i in range(max(X, Y)):
    x = max(X - i, 0)
    y = max(Y - i, 0)
    cost = 2*C * i + A * x + B * y
    ans = min(ans, cost)

print(ans)

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

ans = float("inf")
for i in range(max(X, Y)+1):
    x = max(X - i, 0)
    y = max(Y - i, 0)
    cost = 2*C * i + A * x + B * y
    ans = min(ans, cost)

print(ans)
Buggy code:
def halfandhalf(A,B,C,X,Y):
    if X >= Y:
        if A+B > 2*C:
            sum = C*2*Y + A*(X-Y)
        else:
            sum = A*X + B*Y
        
    else:
        if A+B > 2*C:
            sum = C*2*X + B*(Y-X)
        else:
            sum = A*X + B*Y
    return sum




if __name__ == "__main__":
    A,B,C,X,Y = map(int, input().split())
    print(halfandhalf(A,B,C,X,Y))

Fixed code:
def halfandhalf(A,B,C,X,Y):
    if X >= Y:
        if A+B > 2*C:
            sum = min(C*2*Y + A*(X-Y), C*2*X)
        else:
            sum = A*X + B*Y
        
    else:
        if A+B > 2*C:
            sum = min(C*2*X + B*(Y-X), C*2*Y)
        else:
            sum = A*X + B*Y
    return sum




if __name__ == "__main__":
    A,B,C,X,Y = map(int, input().split())
    print(halfandhalf(A,B,C,X,Y))
Buggy code:
import copy
import math

# a = get_int()
def get_int():
    return int(input())
# a = get_string()
def get_string():
    return input()
# a_list = get_int_list()
def get_int_list():
    return [int(x) for x in input().split()]
# a_list = get_string_list():
def get_string_list():
    return input().split()
# a, b = get_int_multi()
def get_int_multi():
    return map(int, input().split())
# a_list = get_string_char_list()
def get_string_char_list():
    return list(str(input()))
# print("{} {}".format(a, b))
# for num in range(0, a):
# a_list[idx]
# a_list = [0] * a
'''
while (idx < n) and ():

    idx += 1
'''

def main():

    a, b, c, x, y = get_int_multi()
    ans = 100000 * 5000 * 2

    for i in range(0,x+y+1):
        price = i * a
        cnt_c = max(0,(x - i) * 2)
        price += cnt_c * c
        cnt_b = max(0, y - (cnt_c // 2))
        price += cnt_b * b
        ans = min(ans, price)

    print(ans)

if __name__ == '__main__':
    main()




Fixed code:
import copy
import math

# a = get_int()
def get_int():
    return int(input())
# a = get_string()
def get_string():
    return input()
# a_list = get_int_list()
def get_int_list():
    return [int(x) for x in input().split()]
# a_list = get_string_list():
def get_string_list():
    return input().split()
# a, b = get_int_multi()
def get_int_multi():
    return map(int, input().split())
# a_list = get_string_char_list()
def get_string_char_list():
    return list(str(input()))
# print("{} {}".format(a, b))
# for num in range(0, a):
# a_list[idx]
# a_list = [0] * a
'''
while (idx < n) and ():

    idx += 1
'''

def main():

    a, b, c, x, y = get_int_multi()
    ans = 100000 * 5000 * 2

    for i in range(0,x+1):

        for ii in (max(0,(x - i) * 2), max(0,(y - i) * 2, (x - i) * 2)):
            price = i * a

            price += ii * c
            cnt_b = max(0, y - (ii // 2))
            price += cnt_b * b
            ans = min(ans, price)

    print(ans)

if __name__ == '__main__':
    main()
Buggy code:
def solve(a,b,c,x,y):
  k_max = min(x,y)
  l = []
  for i in range(k_max):
    s = a*max((x-i),0)+b*max((y-i),0)+c*i*2
    l.append(s)
  return min(l)   

A,B,C,X,Y = map(int,input().split())
print(solve(A,B,C,X,Y))

Fixed code:
def solve(a,b,c,x,y):
  l = []
  for i in range(10**6):
    s = a*max(x-i,0)+b*max(y-i,0)+c*i*2
    l.append(s)
  return min(l)

        

A,B,C,X,Y = map(int,input().split())
print(solve(A,B,C,X,Y))
Buggy code:
a,b,c,x,y = map(int,input().split())
ans = 0

if c*2 <= a+b:
    x -= min(x,y)
    y -= min(x,y)
    ans += min(x,y)*c*2
    if 0 < a and c*x*2 < a*x:
        ans += (c*x*2)
    elif 0 < b and c*y*2 < b*y:
        ans += (c*y*2)
    else:
        ans += (a*x)+(b*y)
else:
    ans = (a*x)+(b*y)

print(ans)

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

if c*2 <= a+b:
    m = min(x,y)
    ans += m*c*2
    x -= m
    y -= m
    if 0 < x and c*x*2 < a*x:
        ans += (c*x*2)
    elif 0 < y and c*y*2 < b*y:
        ans += (c*y*2)
    else:
        ans += (a*x)+(b*y)
else:
    ans = (a*x)+(b*y)

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

if A + B <= 2 * C:
    pri = A * X + B * Y
else:
    while min(X, Y) >= 1:
        pri += C * 2
        X -= 1
        Y -= 1
    if A * X + B * Y >= 2 * C:
        pri += 2 * C
    else:
        pri += A * X + B * Y

print(pri)


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

if A + B <= 2 * C:
    pri = A * X + B * Y
else:
    while min(X, Y) != 0:
        pri += C * 2
        X -= 1
        Y -= 1
    if A * X + B * Y >= 2 * C * (X + Y):
        pri += 2 * C * (X + Y)
    else:
        pri += A * X + B * Y

print(pri)
Buggy code:
A,B,C,X,Y=map(int,input().split)
a=A*X+B*Y
b=max(X,Y)*C*2
p=B if X<Y else A
c=min(X,Y)*2*C+abs(X-Y)*p
print(min(a,b,c))

Fixed code:
A,B,C,X,Y=map(int,input().split())
a=A*X+B*Y
b=max(X,Y)*C*2
p=B if X<Y else A
c=min(X,Y)*2*C+abs(X-Y)*p
print(min(a,b,c))
Buggy code:
A,B,C,X,Y = map(int,input().split())

plan_P = A*X + B+Y

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

if (A + B) <= 2 * C:
  print(plan_P)
else:
  print(plan_Q)

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:
    if A < 2 * C:
      print(A*(X-Y)+2*C*Y)
    else:
      print(2*C*X)
  else:
    if B < 2 * C:
      print(B*(Y-X)+2*C*X)
    else:
      print(2*C*Y)
Buggy code:
if __name__ == '__main__':
    A, B, C, X, Y = list(map(int, input().split()))
    if A + B < 2 * C:
        print(1)
        print(A * X + B * Y)
    else:
        if X == Y:
            print(2)
            print(C * 2 * X)
        elif X < Y:
            print(3)
            print(X * C * 2 + B * (Y - X))
        else:
            print(4)
            print(Y * C * 2 + A * (X - Y))


Fixed code:
if __name__ == '__main__':
    A, B, C, X, Y = list(map(int, input().split()))
    if A + B <= 2 * C:
        # print(1)
        print(A * X + B * Y)
    else:
        if X == Y:
            # print(2)
            print(C * 2 * X)
        elif X < Y:
            # print(3)
            print(min(X * C * 2 + B * (Y - X), C * 2 * Y))
        else:
            # print(4)
            print(min(Y * C * 2 + A * (X - Y), C * 2 * X))
Buggy code:
a,b,c,x,y = map(int, input().split())
ans = 7000000000
for i in range(10001):
  amount = i*2*c + max(0, x-i)*a + max(0, y-i)*b
  if ans > amount:
    ans = amount
print(ans)




Fixed code:
a,b,c,x,y = map(int, input().split())
ans = 7000000000
for i in range(100001):
  amount = i*2*c + max(0, x-i)*a + max(0, y-i)*b
  if ans > amount:
    ans = amount
print(ans)