N,A,B,X,Y=map(int,input().split()) H=list(map(int,input().split())) L,R=0,10**9 from heapq import * def f(m): a=0 b=0 for i in range(N): a+=max(H[i]-m,0) b+=(max(H[i]-m,0)+X-1)//X if b<=A or a<=B*Y: return 1 Q=[] heapify(Q) for i in range(N): heappush(Q,-max(0,H[i]-m)) for i in range(A): x=heappop(Q) if x==0: return 1 x=-x heappush(Q,-max(0,x-X)) s=0 while len(Q): s-=heappop(Q) if s<=B*Y: return 1 else: return 0 while L>1 if f(M): R=M else: L=max(L+1,M) print(L)