#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, a, b) for (int i = a; i < (int)b; ++i) #define rrep(i, n) for (int i = ((int)n - 1); i >= 0; --i) using ll = long long; using ld = long double; __attribute__((unused)) const ll INF = 1e18; __attribute__((unused)) const int Inf = 1e9; __attribute__((unused)) const double EPS = 1e-9; __attribute__((unused)) const ll MOD = 1000000007; int main() { cin.tie(nullptr); ios::sync_with_stdio(0); int n; ll a, b, x, y; cin >> n >> a >> b >> x >> y; vector h(n); rep(i, n) { cin >> h[i]; } sort(h.begin(), h.end()); ll left = 0LL, right = INF, mid; while (right - left > 1) { mid = (left + right) / 2; vector tmp = h; rep(i, n) tmp[i] -= mid; ll lim = y * b; rep(i, n) { if (tmp[i] <= 0) continue; if (lim >= tmp[i]) { lim -= tmp[i]; tmp[i] = 0; } else { tmp[i] -= lim; break; } } ll cnt = 0; rep(i, n) { if (tmp[i] <= 0) continue; cnt += (tmp[i] + x - 1) / x; } if (cnt <= a) { right = mid; } else { left = mid; } } cout << right << endl; return 0; }