N,K,X,Y = [int(eval(input())) for _ in range(4)]

cnt = 0

for i in range(N):

    if i<K:

        cnt += X

    else:

        cnt += Y

print(cnt)
n,k,x,y = [int(eval(input())) for _ in range(4)]

if n>k:

    print((k*x+(n-k)*y))

else:

    print((n*x))

N, K, X, Y = [int(eval(input())) for _ in range(4)]
cnt = 0
for i in range(N):
    if i < K:
        cnt += X
    else:
        cnt += Y
print(cnt)

n, k, x, y = [int(eval(input())) for _ in range(4)]
if n > k:
    print((k * x + (n - k) * y))
else:
    print((n * x))

-N, K, X, Y = [int(eval(input())) for _ in range(4)] -cnt = 0 -for i in range(N): -    if i < K: -        cnt += X -    else: -        cnt += Y -print(cnt) +n, k, x, y = [int(eval(input())) for _ in range(4)] +if n > k: +    print((k * x + (n - k) * y)) +else: +    print((n * x))