func_code_string: #include <bits/stdc++.h>   using namespace std;   long long n;   bool isvalid(long long x) {     if (x >= 0 && x <= n - 1)       return true;     else       return false;   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> n;     vector<long long> a(n);     for (long long i = 0; i < n; i++) {       cin >> a[i];     }     sort(a.begin(), a.end());     vector<long long> b(n);     b[0] = a[n - 1];     long long i = n - 2;     long long j = n - 3;     long long right = 1;     long long left = n - 1;     while (true) {       if (isvalid(i)) {         b[right] = a[i];         right++;         i -= 2;       }       if (isvalid(j)) {         b[left] = a[j];         left--;         j -= 2;       }       if (isvalid(i) == false && isvalid(j) == false) break;     }     bool done = true;     if (b[0] >= b[1] + b[n - 1]) {       done = false;     }     if (b[n - 1] >= b[n - 2] + b[0]) {       done = false;     }     for (long long i = 1; i <= n - 2; i++) {       if (b[i] >= b[i - 1] + b[i + 1]) {         done = false;         break;       }     }     if (!done) {       cout <<  NO             <<   n ;     } else {       cout <<  YES             <<   n ;       for (long long i = 0; i < n; i++) {         cout << b[i] <<    ;       }     }     return 0;   }   