#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, K, X, Y; cin >> N >> K >> X >> Y; vector A(N); for (auto &&e : A) { cin >> e; e = (e + K - 2) / K; } int x = (Y + X - 1) / X; sort(A.begin(), A.end()); if (N - x < 0) { int64_t res = 0; for (const auto &e : A) { res += e * X; } cout << res << '\n'; } else { int64_t res = A[N - x] * Y; for (int i = N - x; i < N; i++) { res += (A[i] - A[N - x]) * X; } cout << res << '\n'; } return 0; }