from heapq import * def check(m): L = [] for h in H: if h - m > 0: L.append(-h + m) heapify(L) AA = A while AA and L: v = -heappop(L) if v >= X: n = min(AA, v//X) v -= X * n AA -= n if v: heappush(L, -v) else: AA -= 1 L.append(0) return -sum(L) <= B * Y N, A, B, X, Y = map(int, input().split()) H = list(map(int, input().split())) if check(0): print(0) exit() no = 0 yes = 10 ** 9 + 5 while yes - no != 1: mid = (yes + no)//2 if check(mid): yes = mid else: no = mid print(yes)