#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 1000000000000000010 int main(){ long long N,K,X,Y; cin>>N>>K>>X>>Y; vector A(N); for(int i=0;i>A[i]; A[i]--; A[i] = (A[i]+K-1)/K; } sort(A.begin(),A.end()); vector S(N+1,0); for(int i=0;i=1000000001)continue; t += x*X; ans = min(ans,t); } cout<