func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     int n;     cin >> n;     int a[100005];     for (int i = 0; i < n; i++) cin >> a[i];     sort(a, a + n);     if (n == 1) {       cout << -1 << endl;       return 0;     }     bool flag = true;     for (int i = 1; i < n; i++) flag = flag && (a[0] == a[i]);     if (flag) {       cout << 1 << endl;       cout << a[0] << endl;       return 0;     }     if (n == 2) {       if ((a[0] + a[1]) % 2 == 0)         cout << 3 << endl;       else         cout << 2 << endl;       cout << 2 * a[0] - a[1] <<    ;       if ((a[0] + a[1]) % 2 == 0) cout << (a[1] + a[0]) / 2 <<    ;       cout << 2 * a[1] - a[0] <<    ;       return 0;     }     flag = true;     for (int i = 2; i < n; i++) flag = flag && (a[1] - a[0] == a[i] - a[i - 1]);     if (flag) {       cout << 2 << endl;       cout << 2 * a[0] - a[1] <<    ;       cout << 2 * a[n - 1] - a[n - 2] << endl;       return 0;     }     vector<int> diff;     set<int> di;     for (int i = 1; i < n; i++) {       diff.push_back(a[i] - a[i - 1]);       di.insert(a[i] - a[i - 1]);     }     if (di.size() != 2) {       cout << 0 << endl;       return 0;     }     sort(diff.begin(), diff.end());     int chan = diff[n - 2];     if (chan != 2 * diff[0]) {       cout << 0 << endl;       return 0;     }     for (int i = n - 3; i >= 0; i--) {       if (diff[i] == chan || diff[i] != diff[0]) {         cout << 0 << endl;         return 0;       }     }     for (int i = 1; i < n; i++) {       if (a[i] - a[i - 1] == chan) {         if ((a[i] + a[i - 1]) % 2 == 0) {           cout << 1 << endl;           cout << (a[i] + a[i - 1]) / 2 << endl;           return 0;         } else {           cout << 0 << endl;           return 0;         }       }     }     return 0;   }   