import java.util.Scanner; import java.util.TreeMap; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextInt(); TreeMap map = new TreeMap<>(); long sum = 0; for (int i = 0; i < n; i++) { int a = sc.nextInt(); int b = (a + k - 2) / k; if (map.containsKey(b)) { map.put(b, map.get(b) + 1); } else { map.put(b, 1); } sum += b; } sc.close(); long ans = sum * x; long val = ans; int pre = 0; int rem = n; for (int key : map.keySet()) { long d = key - pre; long add = d * y; long sub = d * rem * x; pre = key; rem -= map.get(key); val += add - sub; ans = Math.min(ans, val); } System.out.println(ans); } }