import java.math.BigInteger; 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(); BigInteger x = sc.nextBigInteger(); BigInteger y = sc.nextBigInteger(); 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(); BigInteger ans = BigInteger.valueOf(sum).multiply(x); BigInteger val = ans; int pre = 0; int rem = n; for (int key : map.keySet()) { BigInteger d = BigInteger.valueOf(key - pre); BigInteger add = d.multiply(y); BigInteger sub = d.multiply(x).multiply(BigInteger.valueOf(rem)); pre = key; rem -= map.get(key); val = val.add(add).subtract(sub); if (val.compareTo(ans) < 0) { ans = val; } } System.out.println(ans.toString()); } }