func_code_string: #include <bits/stdc++.h>   using namespace std;   long long int sum[100010], bsum[100010], arr2[100010];   pair<long long int, long long int> arr[100010];   void scanStr(char *str) {     long long int i = 1;     char ch;     for (ch = getchar(); ch !=   n  && ch !=    ; ch = getchar()) str[i++] = ch;     str[i] =   0 ;     return;   }   inline void fastOut(long long int n) {     if (n < 10) {       putchar(n +  0 );       return;     }     fastOut(n / 10);     putchar(n % 10 +  0 );     return;   }   long long int powerFast(long long int a, long long int b) {     long long int i = a, j = 1, k = 1;     while (b) {       if (b & 1) {         k = ((k * i) < 1000000007 ? (k * i) : (k * i) % 1000000007);       }       i = ((i * i) < 1000000007 ? (i * i) : (i * i) % 1000000007);       b = b >> 1;     }     return k;   }   inline long long int scan() {     long long int n = 0;     char c;     for (c = getchar(); c ==     || c ==   n  || c ==   t ; c = getchar())       ;     for (; c > 0x2f && c < 0x3a; c = getchar()) n = (n * 10) + (c & 0x0f);     return n;   }   bool comp(pair<long long int, long long int> a,             pair<long long int, long long int> b) {     if (a.first < b.first) return false;     return true;   }   int main() {     long long int N, A, cf, cm, M, i, j, K, t, tmin, tnA, maxx;     N = scan();     A = scan();     cf = scan();     cm = scan();     M = scan();     for (i = 1; i <= N; i++) {       arr[i].first = scan();       arr[i].second = i;     }     sort(arr + 1, arr + N + 1,          std::greater<pair<long long int, long long int> >());     for (i = 1; i <= N; i++) {       sum[i] = sum[i - 1] + arr[i].first;     }     long long int loc1, loc2, val;     maxx = LONG_MIN;     j = 1;     for (i = 0; i <= N; i++) {       K = M - (A * i - sum[i]);       if (K < 0) {         break;       }       tnA = i;       tmin = A;       for (j = max(i + 1, j); j <= N; j++) {         t = arr[j].first * (N - j + 1);         t = t - (sum[N] - sum[j - 1]);         if (t <= K) {           t = K - t;           tmin = min(arr[j].first + t / (N - j + 1), A);           break;         }       }       if ((cf * tnA + cm * tmin) >= maxx) {         maxx = cf * tnA + cm * tmin;         loc1 = i;         loc2 = j;         val = tmin;       }     }     cout << maxx <<   n ;     for (i = 1; i <= loc1; i++) {       arr2[arr[i].second] = A;     }     for (i = loc1 + 1; i < loc2; i++) {       arr2[arr[i].second] = arr[i].first;     }     for (i = loc2; i <= N; i++) {       arr2[arr[i].second] = val;     }     for (i = 1; i <= N; i++) {       fastOut(arr2[i]);       putchar(   );     }     return 0;   }   