#include using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() const int mod = 1000000007; const long long INF = 1LL << 60; using ll = long long; ll N,A,B,X,Y; vector H; bool solve(ll K){ auto h=H; rep(i,N){ h[i]-=K; if(h[i]<0) h[i]=0; } priority_queue> que; rep(i,N){ que.push(make_pair(h[i],i)); } rep(iter,A){ auto Q=que.top(); ll maxh=Q.first; ll i=Q.second; que.pop(); h[i]-=X; if(h[i]<0) h[i]=0; que.push(make_pair(h[i],i)); } ll sum=0; rep(i,N){ if(h[i]>0) sum+=h[i]; } return sum>B*Y; } int main() { cin >> N >> A >> B >> X >> Y; H.resize(N); rep(i,N){ cin >> H[i]; } ll OK=-1; ll NG=10010010010; while(abs(OK-NG)>1){ ll mid=(OK+NG)/2; if(solve(mid)){ OK=mid; } else{ NG=mid; } } cout << OK+1 << endl; }