func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   int main() {     cin >> n;     vector<int> d(n), bal(n + 2);     vector<long long> pref(n + 1);     for (int i = 0; i < n; i++) scanf( %d , &d[i]);     sort(d.begin(), d.end());     for (int i = 0; i < n; i++) pref[i + 1] = pref[i] + d[i];     int j = 0;     for (int k = 1; k <= n; k++) {       long long L = pref[n] - pref[n - k], R = (long long)k * (k - 1);       while (j < n && d[j] < k) j++;       int up = min(n - k, j);       R += pref[up] + (long long)k * ((n - k) - up);       int bound = d[n - k];       {         long long diff = L - R;         if (diff <= k && diff <= bound) {           bal[max(diff, 0LL)]++;           bal[bound + 1]--;         }       }       {         L -= d[n - k];         R += min(d[n - k], k);         long long diff = R - L;         if (diff >= bound + 1) {           bal[bound + 1]++;           bal[min(diff + 1, n + 1LL)]--;         }       }     }     vector<int> res;     int B = 0;     for (int i = 0; i <= n; i++) {       B += bal[i];       if (B == n) {         if ((pref[n] + i) % 2 == 0) {           res.push_back(i);         }       }     }     if (res.empty()) return cout << -1 << endl, 0;     for (int i = 0; i < (int)res.size(); i++) cout << res[i] <<    ;     return 0;   }   