func_code_string: #include <bits/stdc++.h>   using namespace std;   const long double PI = acos(-1);   long long powm(long long a, long long b) {     long long res = 1;     while (b) {       if (b & 1) res = (res * a) % 1000000007;       a = (a * a) % 1000000007;       b >>= 1;     }     return res;   }   long long gcd(long long a, long long b) {     if (b == 0) return a;     return gcd(b, a % b);   }   const long long maxn = 2 * 1e5 + 10;   map<long long, long long> dif;   void solve() {     long long n;     cin >> n;     long long a[n + 2];     for (long long i = 1; i <= n; i++) {       cin >> a[i];     }     sort(a + 1, a + n + 1);     for (long long i = 2; i <= n; i++) {       long long cur = a[i] - a[i - 1];       dif[cur]++;     }     if (dif.size() > 2) {       cout << 0 << endl;     } else if (n == 1) {       cout << -1 << endl;     } else if (n == 2) {       if ((a[2] - a[1]) % 2 == 0 && a[2] != a[1]) {         cout << 3 << endl;         cout << a[1] - (a[2] - a[1]) <<     << a[1] + (a[2] - a[1]) / 2 <<                  << a[2] + (a[2] - a[1]) << endl;       } else if (a[1] == a[2]) {         cout << 1 << endl;         cout << a[1] << endl;       } else {         cout << 2 << endl;         cout << a[1] - (a[2] - a[1]) <<     << a[2] + (a[2] - a[1]) << endl;       }     } else if (dif.size() == 2 && n > 1) {       long long mx = 0, d = 1000000000, z = 0;       vector<long long> s;       for (auto i : dif) {         if (i.first == 0) z = 1;         if (mx <= i.second) {           mx = i.second;           d = min(d, i.first);         }         s.push_back(i.first);       }       if (z || dif[s[0]] < n - 2 || s[1] % 2 != 0 ||           (s[1] % 2 == 0 && s[1] / 2 != s[0]))         cout << 0 << endl;       else {         for (long long i = 2; i <= n; i++) {           if (a[i] - a[i - 1] != d) {             if ((a[i] - a[i - 1]) > d && (a[i] - a[i - 1]) % 2 == 0 &&                 (a[i] - a[i - 1]) / 2 == d) {               cout << 1 << endl;               cout << a[i - 1] + d << endl;             } else {               cout << 0 << endl;               break;             }           }         }       }     } else if (dif.size() == 1) {       long long d = 0;       for (auto i : dif) {         d = i.first;       }       if (d) {         cout << 2 << endl;         cout << a[1] - (a[2] - a[1]) <<     << a[n] + (a[2] - a[1]) << endl;       } else {         cout << 1 << endl;         cout << a[1] << endl;       }     } else       cout << 0 << endl;   }   signed main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     long long t = 1;     for (long long i = 1; i <= t; i++) {       solve();     }     return 0;   }   