n, A, B, X, Y = map(int, input().split()) H = list(map(int, input().split())) def ok(k): lst = [] a, b, x, y = A, B, X, Y for i in range(n): h = H[i] - k if h <= 0: continue c = h // x h -= min(a, c) * x a -= min(a, c) if h > 0: lst.append(h) lst.sort(reverse = True) lst = lst[a:] return sum(lst) <= y * b l = -1 r = 1 << 30 while r - l > 1: mid = (l + r) // 2 if ok(mid): r = mid else: l = mid print(r)