local mmi, mma = math.min, math.max local mfl, mce = math.floor, math.ceil local n, k = io.read("*n", "*n") local x, y = io.read("*n", "*n") local t = {} for i = 1, n do local a = io.read("*n") t[i] = mce((a - 1) / k) end table.sort(t) local lim = mce(y / x) lim = mmi(lim, n + 1) k = 0LL + k x, y = 0LL + x, 0LL + y local ret = 0LL local cursum = 0LL for i = 1, n do t[i] = 0LL + t[i] end for i = 1, n + 1 - lim do if cursum < t[i] then local rem = t[i] - cursum ret = ret + rem * y cursum = cursum + rem end end for i = n + 2 - lim, n do local rem = t[i] - cursum if 0 < rem then ret = ret + rem * x end end local str = tostring(ret):gsub("LL", "") print(str)