N = int(eval(input()))

K = int(eval(input()))

X = int(eval(input()))

Y = int(eval(input()))

P = 0

for i in range(1,N+1):

  if i <= K:

    P = P + X

  else:

    P = P + Y

print(P)
N, K, X, Y = (int(eval(input())) for i in range(4))

P = 0

for i in range(1,N+1):

  if i <= K:

    P = P + X

  else:

    P = P + Y

print(P)
N = int(eval(input()))
K = int(eval(input()))
X = int(eval(input()))
Y = int(eval(input()))
P = 0
for i in range(1, N + 1):
    if i <= K:
        P = P + X
    else:
        P = P + Y
print(P)

N, K, X, Y = (int(eval(input())) for i in range(4))
P = 0
for i in range(1, N + 1):
    if i <= K:
        P = P + X
    else:
        P = P + Y
print(P)

-N = int(eval(input())) -K = int(eval(input())) -X = int(eval(input())) -Y = int(eval(input())) +N, K, X, Y = (int(eval(input())) for i in range(4))