output_description: Output the total price.
input_description: The input is given in the following format.
  
      
      
      $A$ $B$ $X$
      
  
  The first line provides the prices for a 1-liter bottle $A$ ($1\leq A \leq
  1000$), 500-milliliter bottle $B$ ($1 \leq B \leq 1000$), and the total water
  quantity needed $X$ ($1 \leq X \leq 20000$). All these values are given as
  integers, and the quantity of water in milliliters.
attempt: import math
  
  A, B, X = map(int, input().split())
  ans = float("inf")
  
  for a in range(math.ceil(X / 1000) + 1):
      if X - 1000 * a < 0:
          b = 0
      else:
          b = math.ceil((X - 1000 * a) / 500)
      ans = min(ans, A * a + B * b)
  
  print(ans)
  
problem_description: Heat Stroke
  
  We have had record hot temperatures this summer. To avoid heat stroke, you
  decided to buy a quantity of drinking water at the nearby supermarket. Two
  types of bottled water, 1 and 0.5 liter, are on sale at respective prices
  there. You have a definite quantity in your mind, but are willing to buy a
  quantity larger than that if: no combination of these bottles meets the
  quantity, or, the total price becomes lower.
  
  Given the prices for each bottle of water and the total quantity needed, make
  a program to seek the lowest price to buy greater than or equal to the
  quantity required.
samples: [{"input": "180 100 2400", "output": "460"}, {"input": "200 90 2018", "output": "450"}]