n,a,b,x,y = map(int,input().split()) h = list(map(int,input().split())) from heapq import heappush, heappop ng,ok = -1,10**9 while ok-ng>1: k = (ok+ng)//2 hq = [] for i in h: heappush(hq,min(0,k-i)) for i in range(a): t = heappop(hq) t = min(0,t+x) heappush(hq,t) if -sum(hq)<=b*y: ok = k else: ng = k print(ok)