from sys import stdin from heapq import heappush, heappop n, a, b, x, y, *h = map(int, stdin.read().split()) left = -1 right = 10**9+1 while right - left >= 2: mid = (right + left) // 2 hq = [] for i in range(n): if h[i] - mid > 0: heappush(hq, -(h[i]-mid)) for i in range(a): if hq: now = -heappop(hq) if now > x: kari = now - x heappush(hq, -kari) kari = 0 while hq: kari += -heappop(hq) if kari <= b * y: right = mid else: left = mid print("{}".format(right))