#include #define rep(i,n) for (int i=0; i<(n); ++i) using namespace std; using ll=long long; int main(){ int n,k,x,y; cin>>n>>k>>x>>y; vectora(n); queueq; rep(i,n){ cin>>a[i]; a[i]--; } sort(a.begin(),a.end()); rep(i,n)q.push(a[i]); ll ans=0; int now=0; while(1){ while(1){ if(q.front()<=now)q.pop(); else break; if(q.empty())break; } if(q.empty())break; if((ll)x*q.size()>(ll)y){ now+=k,ans+=y; } else{ now+=k,ans+=(ll)x*q.size(); } } cout<