N = int(eval(input()))

K = int(eval(input()))

X = int(eval(input()))

Y = int(eval(input()))

if N > K:

	a = X * K + Y * (N - K)

else:

	a = X * N

print(a)
N = int(eval(input()))

K = int(eval(input()))

X = int(eval(input()))

Y = int(eval(input()))

if N <= K:

	print((X*N))

else:

	ans = X*K + Y*(N-K)

	print(ans)
N = int(eval(input()))
K = int(eval(input()))
X = int(eval(input()))
Y = int(eval(input()))
if N > K:
    a = X * K + Y * (N - K)
else:
    a = X * N
print(a)

N = int(eval(input()))
K = int(eval(input()))
X = int(eval(input()))
Y = int(eval(input()))
if N <= K:
    print((X * N))
else:
    ans = X * K + Y * (N - K)
    print(ans)

-if N > K: -    a = X * K + Y * (N - K) +if N <= K: +    print((X * N)) -    a = X * N -print(a) +    ans = X * K + Y * (N - K) +    print(ans)