n, a, b, x, y = map(int,input().split()) h = list(map(int,input().split())) def solve(n, a, b, x, y, h): h.sort() from collections import deque def check(k): q1 = deque() q2 = deque() for i in range(n): q1.appendleft(max(h[i] - k, 0)) for _ in range(a): now = 0 if not q1: now = q2.pop() elif not q2: now = q1.pop() elif q1[-1] > q2[-1]: now = q1.pop() else: now = q2.pop() now = max(now - x, 0) q2.appendleft(now) if sum(q1) + sum(q2) <= b * y: return True else: return False ok = 10 ** 9 ng = -1 while abs(ok - ng) > 1: mid = (ok + ng) // 2 if check(mid): ok = mid else: ng = mid return ok print(solve(n, a, b, x, y, h))