Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. a, b, c, x, y = map(int, input().split(' '))
  2.  
  3. min_price = 100000 * 3 * 5000
  4. for pizza_c in range(max(x, y) * 2 + 1):
  5. pizza_a = max(x - int(pizza_c / 2), 0)
  6. pizza_b = max(y - int(pizza_c / 2), 0)
  7. min_price = min(pizza_a * a + pizza_b * b + pizza_c * c, min_price)
  8. print(min_price)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement