func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, w, a[105], cnt1 = 0, cnt = 0, b[105], c[105], e[105], colour[105];     memset(colour, 0, sizeof colour);     scanf( %d%d , &n, &w);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       c[i] = a[i];       cnt1 = a[i] / 2;       if (a[i] % 2 == 1) cnt1++;       b[i] = cnt1;       cnt += cnt1;     }     if (cnt > w) {       printf( -1 n );       return 0;     }     if (w > cnt) {       int dif = w - cnt;       sort(c + 1, c + n + 1);       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= n; j++) {           if (c[i] == a[j] && colour[j] == 0) {             e[i] = j;             colour[j] = 1;             break;           }         }       }       int d = n;       while (d > 0) {         if (c[d] % 2 == 1) {           int k = c[d] / 2 + 1;           int diff = c[d] - k;           if (dif > diff) {             dif -= diff;             b[e[d]] += diff;           } else             b[e[d]] += dif, dif = 0;         } else {           int k = c[d] / 2;           int diff = c[d] - k;           if (dif > diff) {             dif -= diff;             b[e[d]] += diff;           } else             b[e[d]] += dif, dif = 0;         }         if (dif == 0) break;         d--;       }       if (dif > 0) {         printf( -1 n );         return 0;       }       for (int i = 1; i <= n; i++) printf( %d  , b[i]);     } else if (cnt == w) {       for (int i = 1; i <= n; i++) printf( %d  , b[i]);     }   }   