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): import heapq h2 = [0] * n for i in range(n): h2[i] = min(0, k - h[i]) heapq.heapify(h2) for i in range(a): now = heapq.heappop(h2) now = min(0, now + x) heapq.heappush(h2, now) if -sum(h2) <= 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))