#include int ri() { int n; scanf("%d", &n); return n; } int main() { int n = ri(); int k = ri(); int x = ri(); int y = ri(); int a[n + 1]; for (int i = 0; i < n; i++) { int x = ri() - 1; a[i] = x ? (x - 1) / k + 1 : x; } a[n] = 0; std::sort(a, a + n, std::greater<>()); int64_t cost0 = 0; int64_t res = 1000000000000000000; for (int i = 0; i <= n; i++) { if (cost0 > 1000000000) continue; res = std::min(res, (int64_t) x * cost0 + (int64_t) y * a[i]); if (i < n) cost0 += (int64_t) (a[i] - a[i + 1]) * (i + 1); } printf("%" PRId64 "\n", res); return 0; }