#yuki1071 N,K,X,Y=map(int,input().split()) A=list(map(int,input().split())) B=[0]*N for i in range(0,N): B[i]=(A[i]+K-2)//K B.sort() R=[0]*(N+1) for i in range(0,N): R[N-i-1]=R[N-i]+B[N-i-1] res=R[0]*X for i in range(0,N): t=B[i]*Y+(R[i+1]-(N-1-i)*B[i])*X res=min(res,t) print(res)