//TLE解法 #include using namespace std; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) ll gcd(ll(a), ll(b)) { ll c = a; while (a % b != 0) { c = a % b; a = b; b = c; } return b; } vll DP(300005,1e18); ll dfs(ll n){ if(n==1){ DP[1]=0; return 0; } ll res=1e18; if(DP[n]<1e17)return DP[n]; for(ll i=1;i*i<=n;i++){ //cout<1e17)dfs(i); res=min(res,DP[i]+n/i); if(i!=1)if(DP[n/i]>1e17)dfs(n/i); res=min(res,DP[n/i]+i); } } DP[n]=res; return res; } int main() { ll N,A,B,X,Y; cin>>N>>A>>B>>X>>Y; ll S=0; vll G(N); rep(i,N){ ll H; cin>>H; while(H>=X&&A>0){ H-=X; A--; } G[i]=H; } sort(all(G)); reverse(all(G)); for(ll i=A;i