def ceildiv(a: int, b: int) -> int: return (a + b - 1) // b N, K, X, Y = map(int, input().split()) A = list(map(int, input().split())) def f(): xs = sorted([ceildiv(a-1, K) for a in A], reverse=True) res = 0 tot = 0 # 回復合計 while len(xs) > 0: # ベホイミのコスト c1 = X * len(xs) # ベホマラーのコスト c2 = Y cost = min(c1, c2) t = xs[-1] - tot res += cost * t tot += t while xs and xs[-1] <= tot: xs.pop() return res ans = f() print(ans)