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