output_description: Print the smallest number of yen you have to spend to buy exactly N liters of
  ice tea.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      Q H S D
      N
attempt: q, h, s, d = map(int, input().split())
  n = int(input())
  ans = 0
  q_per = q / 0.25
  h_per = h / 0.5
  s_per = s
  d_per = d / 2
  list = [q_per,h_per,s_per,d_per]
  elif min(list) == d_per :
      if n%2 == 0:
          ans += d * (n //2)
      else :
          ans += n//2 * d
          n -= n//2
          list.remove(d_per)
          if min(list) == s_per :
              ans += s_per
          elif min(list) == h_per :
              ans += h * 2
          else :
              ans += q * 4
  elif min(list) == s_per :
      ans += n * s
  elif min(list) == h_per :
      ans += n * 2 * h
  else :
      ans += n * 4 * q
  
  print(int(ans))
  
problem_description: Statement
  
  You've come to your favorite store Infinitesco to buy some ice tea.
  
  The store sells ice tea in bottles of different volumes at different costs.
  Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen,
  a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has
  an infinite supply of bottles of each type.
  
  You want to buy exactly N liters of ice tea. How many yen do you have to
  spend?
samples: [{"input": "20 30 70 90\n    3", "output": "150\n    \n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 +\n30 + 30 = 150 yen.\n\n* * *"}, {"input": "10000 1000 100 10\n    1", "output": "100\n    \n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter. Thus,\nyou have to buy a 1-liter bottle for 100 yen.\n\n* * *"}, {"input": "10 100 1000 10000\n    1", "output": "40\n    \n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\n* * *"}, {"input": "12345678 87654321 12345678 87654321\n    123456789", "output": "1524157763907942"}]