n,k,x,y = map(int,input().split()) a = [int(i)-1 for i in input().split()] ali = [0]*(n+1) for i in range(n): ali[i+1] = (a[i]+k-1)//k ali.sort() ans = 0 idx = -1 for i in range(n): if (n-i) * x > y: idx = i continue else: ans += (ali[i+1]-ali[idx+1])*x ans += ali[idx+1]*y print(ans)