#include #include using namespace std; typedef long long ll; int main() { int n, a, b; ll x, y; cin >> n >> a >> b >> x >> y; ll h[3005]; for(int i = 0; i < n; i++) cin >> h[i]; ll left = -1, right = 1000000000; while(right - left > 1){ ll mid = (right + left) / 2; priority_queue que; for(int i = 0; i < n; i++) que.push(max(0ll, h[i] - mid)); for(int i = 0; i < a; i++){ ll u = que.top(); que.pop(); u = max(0ll, u - x); que.push(u); } ll s = 0; while(que.size()){ s += que.top(); que.pop(); } if(s <= b * y) right = mid; else left = mid; } cout << right << endl; }