#include #define rep(i, l, r) for (int i = (l); i < (r); i++) using namespace std; typedef long long ll; int main() { int N, A, B, X, Y; cin >> N >> A >> B >> X >> Y; vector H(N); rep(i, 0, N) cin >> H[i]; int ok = 1e9, ng = -1; while (ok > ng + 1) { int md = (ok + ng) / 2; priority_queue pq; rep(i, 0, N) { pq.push(max(0, H[i] - md)); } rep(i, 0, A) { int p = pq.top(); pq.pop(); pq.push(max(0, p - X)); } ll S = 0; while (!pq.empty()) { int p = pq.top(); pq.pop(); S += p; //cout << "p=" << p << endl; } if (1LL * Y * B >= S) ok = md; else ng = md; } cout << ok << endl; }