N, K, X, Y = gets.split(" ").map{|s| s.to_i} a = gets.split(" ").map{|s| s.to_i} a.sort! h = 1 m = 0 i = a.bsearch_index{|x| x > h} if i then n = N - i minh = a[i] - h else n = 0 minh = 0 end while n > 0 do v = n * X > Y ? Y : n * X p = (K - 1 + minh) / K m += p * v h += K * p i = a.bsearch_index{|x| x > h} if i then n = N - i minh = a[i] - h else n = 0 minh = 0 end end puts m