func_code_string: #include <bits/stdc++.h>   using namespace std;   template <class T>   void chmin(T &t, const T &f) {     if (t > f) t = f;   }   template <class T>   void chmax(T &t, const T &f) {     if (t < f) t = f;   }   int main() {     long long int n, a, c1, c2, m, len = 0, prev = 0, ans = 0, rlow, rlen, rind,                                    ret[100005];     vector<pair<long long int, long long int> > v;     vector<long long int> sum;     scanf( %I64d %I64d %I64d %I64d %I64d , &n, &a, &c1, &c2, &m);     for (long long int i = 0; i < n; ++i) {       long long int x;       scanf( %I64d , &x);       v.push_back(make_pair(x, i));     }     if (n == 1) {       long long int maxi = min(a, v[0].first + m);       printf( %I64d n , c1 * (maxi == a ? 1 : 0) + maxi * c2);       printf( %I64d  , maxi);       return 0;     }     sort(v.begin(), v.end());     sum.push_back(0);     for (int i = 1; i < n; ++i)       sum.push_back((v[i].first - v[i - 1].first) * i + sum[i - 1]);     while (len <= n) {       if (len - 1 >= 0) prev += a - v[n - len].first;       if (prev > m) break;       long long int newm = m - prev;       long long int ind = upper_bound(sum.begin(), sum.end(), newm) - sum.begin();       ind = max(0ll, min((long long int)ind - 1, (long long int)n - len - 1));       newm -= sum[ind];       long long int low = min(v[ind].first + (newm / (ind + 1)), a);       if (ans < len * c1 + low * c2) {         ans = len * c1 + low * c2;         rlow = low;         rind = ind;         rlen = len;       }       len++;     }     for (int i = 0; i < n; ++i) ret[v[i].second] = v[i].first;     for (int i = 0; i <= rind; ++i) ret[v[i].second] = max(v[i].first, rlow);     for (int i = n - 1; i >= n - rlen; --i) ret[v[i].second] = a;     printf( %I64d n , ans);     for (int i = 0; i < n; ++i) printf( %I64d  , ret[i]);     return 0;   }   