func_code_string: #include <bits/stdc++.h>   using namespace std;   inline long long read() {     long long ret = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) ret = ret * 10 + ch -  0 , ch = getchar();     return ret * f;   }   const long long maxn = 100005;   long long n, A, cj, cm, m;   pair<long long, long long> a[maxn];   long long sum[maxn];   long long ans = 0, ansx = -1, ansy = -1;   inline bool cmp_value(pair<long long, long long> aa,                         pair<long long, long long> bb) {     return aa.first < bb.first;   }   inline bool cmp_id(pair<long long, long long> aa,                      pair<long long, long long> bb) {     return aa.second < bb.second;   }   inline long long get_all_sum(long long x, long long up) {     long long L = 1, R = up;     long long ret = 0;     while (L <= R) {       long long mid = ((R - L) >> 1) + L;       if (a[mid].first > x)         R = mid - 1;       else         ret = x * mid - sum[mid], L = mid + 1;     }     return ret;   }   signed main() {     n = read();     A = read();     cj = read();     cm = read();     m = read();     for (long long i = 1; i <= n; i++) a[i].first = read(), a[i].second = i;     sort(a + 1, a + 1 + n, cmp_value);     for (long long i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i].first;     long long need = 0;     for (long long i = n + 1; i >= 1; i--) {       if (i <= n) need += A - a[i].first;       if (need > m) break;       long long L = 0, R = A;       while (L <= R) {         long long mid = ((R - L) >> 1) + L;         long long all_sum = get_all_sum(mid, i - 1);         if (all_sum > m - need)           R = mid - 1;         else {           if ((n - i + 1) * cj + mid * cm > ans) {             ans = (n - i + 1) * cj + mid * cm;             ansx = mid;             ansy = i;           }           L = mid + 1;         }       }     }     printf( %lld n , ans);     if (ansx != -1 && ansy != -1) {       for (long long i = 1; i < ansy; i++) a[i].first = max(ansx, a[i].first);       for (long long i = ansy; i <= n; i++) a[i].first = A;     }     sort(a + 1, a + 1 + n, cmp_id);     for (long long i = 1; i <= n; i++) printf( %lld  , a[i].first);     printf(  n );     return 0;   }   