#include using namespace std; using ll = long long int; using lc = complex; int main(void) { constexpr ll MOD = 1e9 + 7; constexpr double PI = acos(-1); cout << fixed << setprecision(32); cin.tie(0); ios::sync_with_stdio(false); ll n, k, x, y; cin >> n >> k >> x >> y; vector a(n); for(auto &e: a) cin >> e, e = (e+k-1-1)/k; sort(a.begin(), a.end()); ll r = 0, i = 0, t = 0; while(i < n) { if(x * (n - i) < y) { r += x * (a[i] - t); } else { r += y * (a[i] - t); t = a[i]; } i++; } cout << r << endl; }