from heapq import heappop,heappush N,A,B,X,Y = map(int,input().split()) H = list(map(int,input().split())) def is_ok(nH,nA): q = [] for h in nH: if h > 0: heappush(q,-h) while nA and q: h = heappop(q) h *= -1 if h > X: heappush(q,-(h-X)) nA -=1 SUMS = 0 for h in q: SUMS += -h if SUMS <= Y * B: return True else: return False ok = 10 ** 9 ng = -1 while ok - ng > 1: x = (ng+ok)//2 nH = [] for i in range(N): nH.append(H[i]-x) if is_ok(nH,A): ok = x else: ng = x print(ok)