import sys import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, K, X, Y = map(int, readline().split()) A = np.array(read().split(), np.int64) # 必要回数になおす A -= 1 A = (A + K - 1) // K A.sort() A = A[::-1] A = np.append(A, 0) Acum = np.cumsum(A) x = Acum - np.arange(1, N + 2, dtype=np.int64) * A y = A cost = x * X + y * Y x, y print(cost.min())