#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; priority_queue pq; rep(i, n) { ll tmp = h[i] - mid; if (tmp <= 0) continue; pq.push(tmp); } rep(i, a) { if (pq.size() == 0) break; ll t = pq.top(); pq.pop(); t -= x; if (t <= 0) continue; pq.push(t); } ll lim = y * b; while (!pq.empty()) { ll t = pq.top(); pq.pop(); lim -= t; } if (lim >= 0) right = mid; else left = mid; } cout << right << endl; return 0; }