def General_Binary_Increase_Search_Integer(L,R,cond,default=None): """条件式が単調増加であるとき, 整数上で二部探索を行う. L: 解の下限 R: 解の上限 cond: 条件(1変数関数, 広義単調増加を満たす) default: Lで条件を満たさないときの返り値 """ if not(cond(R)): return default if cond(L): return L R+=1 while R-L>1: C=L+(R-L)//2 if cond(C): R=C else: L=C return R #================================================== from heapq import heapify,heappop,heappush def check(K): HH=[-(hp-K) for hp in H if hp>K] heapify(HH) for _ in range(A): if not HH: continue hp=-heappop(HH) if hp>=X: heappush(HH,-(hp-X)) return -sum(HH)<=Y*B #================================================== N,A,B,X,Y=map(int,input().split()) H=list(map(int,input().split())) print(General_Binary_Increase_Search_Integer(0,max(H),check,-1))