from heapq import * N,A,B,X,Y = map(int,input().split()) H = list(map(int,input().split())) def check(x): Q = [] for h in H: if h - x > 0: heappush(Q,x - h) for _ in range(A): if Q: a = heappop(Q) if a + X < 0: heappush(Q,a+X) return -sum(Q) <= B * Y lb = -1 ub = 10 ** 9 while ub - lb > 1: mid = (ub + lb) // 2 if check(mid): ub = mid else: lb = mid print(ub)