N, K, X, Y = map(int, input().split()) A = list(map(int, input().split())) A = [ (a-2+K) // K for a in A ] A.sort() S = [0] * (N+1) for i in range(N-1, -1, -1): S[i] = S[i+1] + A[i] ans = S[0] * X for i in range(N): ans = min(ans, A[i] * Y + (S[i] - (N-i)*A[i]) * X) print(ans)