import math N,K,X,Y=map(int,input().split()) Ax=list(map(lambda x:int(x),input().split())) B=[(a-1+K-1)//K for a in Ax] B.sort(reverse=True) if Y <= X: print(Y*B[0]) exit() t = math.ceil(Y/X)-1 if t