Buggy python submission (verdict: Runtime Error):
Q,H,S,D = map(int,input().spllit())
N = int(input())

h = min(H , 2*Q)
s = min(2*h,S)
d = min(2*s,D)

if N % 2 == 0:
  print((N//2 * d))
else:
  print((N//2)*d + s)

Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)

Buggy python submission (verdict: Runtime Error):
Q,H,S,D = map(int,input().spllit())
N = int(input())

h = min(H , 2*Q)
s = min(2*h,S)
d = min(2*s,D)

if N % 2 == 0:
  print((N//2 * d))
else:
  print((N//2)*d + s)

Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)

Buggy python submission (verdict: Runtime Error):
Q,H,S,D = map(int,input().spllit())
N = int(input())

h = min(H , 2*Q)
s = min(2*h,S)
d = min(2*s,D)

print((N//2)*d + (N%2)*s)

Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)

Buggy python submission (verdict: Runtime Error):
Q,H,S,D = map(int,input().spllit())
N = int(input())

h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)

print((N//2)*d + (N%2)*s)

Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)

Buggy python submission (verdict: Runtime Error):
Q,H,S,D = map(int,input().spllit())
N = int(input())

h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)

print((N//2)*d + (N%2)*s)

Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)

Buggy python submission (verdict: Runtime Error):
m = input().split()
Q = int(m[0])
H = int(m[1])
S = int(m[2])
D = int(m[3])
N = int(input())

list_1 = [S, 2*H, 4*D]
list_1.sort()

min_1 = list[0]

if D < (min_1 * 2):
  total_cost = D * (N // 2) + min_1 * (N % 2)
else:
  total_cost = min_1 * N

print(total_cost)


Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)

Buggy python submission (verdict: Runtime Error):
m = input().split()
Q = int(m[0])
H = int(m[1])
S = int(m[2])
D = int(m[3])
N = int(input())

list_1 = [S, 2*H, 4*D]
list_1.sort()

min_1 = list[0]

if D < (min_1 * 2):
  total_cost = D * (N // 2) + min_1 * (N % 2)
else:
  total_cost = min_1 * N

print(total_cost)


Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)

Buggy python submission (verdict: Time Limit Exceeded):
m = input().split()
Q = int(m[0])
H = int(m[1])
S = int(m[2])
D = int(m[3])

ans = 0
N = int(input())

for d in range((N // 2) + 1 ):
  s_set = N - (2*d)
  for s in range(s_set + 1):
    h_set = N - (2*d + 1*s)
    for h in range(h_set * 2 +1):
      q = int( 4 * (N - (2*d + 1 * s + 0.5 * h)))
      money = d*D + s*S + h*H + q*Q

      if (ans == 0) or (ans > money):
        ans = money

print(ans)

Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)

Buggy python submission (verdict: Time Limit Exceeded):
m = input().split()
Q = int(m[0])
H = int(m[1])
S = int(m[2])
D = int(m[3])

ans = 0
N = int(input())

for d in range((N // 2) + 1 ):
  s_set = N - (2*d)
  for s in range(s_set + 1):
    h_set = N - (2*d + 1*s)
    for h in range(h_set * 2 +1):
      q = int( 4 * (N - (2*d + 1 * s + 0.5 * h)))
      money = d*D + s*S + h*H + q*Q

      if (ans == 0) or (ans > money):
        ans = money

print(ans)

Fixed submission:
Q,H,S,D = map(int,input().split())
N = int(input())
h = min(2*Q,H)
s = min(2*h,S)
d = min(2*s,D)
print((N//2)*d + (N%2)*s)