from heapq import heappop, heappush N, A, B, X, Y = map(int, input().split()) H = list(map(int, input().split())) def judge(k): q = [] sm = 0 for i in range(N): if H[i]>k: heappush(q,-H[i]+k) sm += H[i]-k cnt = A while q and cnt>0: v = -heappop(q) if v>X: sm -= X heappush(q,-v+X) else: sm -= v cnt -= 1 if sm<=B*Y: return True else: return False ok, ng = 10**9,-1 while ok-ng>1: mid = (ok+ng)//2 if judge(mid): ok = mid else: ng = mid print(ok)