import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Collections; import java.util.PriorityQueue; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int n = Integer.parseInt(sa[0]); int a = Integer.parseInt(sa[1]); int b = Integer.parseInt(sa[2]); int x = Integer.parseInt(sa[3]); int y = Integer.parseInt(sa[4]); sa = br.readLine().split(" "); long[] h = new long[n]; for (int i = 0; i < n; i++) { h[i] = Integer.parseInt(sa[i]); } br.close(); long yb = (long) y * b; long ok = 1000000000000000L; long ng = -1; while (Math.abs(ok - ng) > 1) { long mid = (ok + ng) / 2; PriorityQueue que = new PriorityQueue<>(Collections.reverseOrder()); for (int i = 0; i < n; i++) { que.add(Math.max(h[i] - mid, 0)); } for (int i = 0; i < a; i++) { que.add(Math.max(que.poll() - x, 0)); } long sum = 0; for (long e : que) { sum += e; } if (sum <= yb) { ok = mid; } else { ng = mid; } } System.out.println(ok); } }