n,k,x,y = map(int,input().split()) A = list(map(int,input().split())) l = 0 r = 10**20 def calc(m): count = 0 for a in A: if a-1 <= m*k: continue count += (a-1-m*k+(k-1))//k*x return count + y*m while r > l+2: c1 = (l*2+r)//3 c2 = (l+r*2)//3 if calc(c1) <= calc(c2): r = c2 else: l = c1 ans = 10**20 for i in range(l,r+2): ans = min(ans,calc(i)) print(ans)