func_code_string: #include <bits/stdc++.h>   #pragma GCC target( avx2 )   #pragma GCC optimization( O3 )   #pragma GCC optimization( unroll-loops )   using namespace std;   const int maxn = 2e5 + 5;   const double PI = 3.14159265358979323846;   void solve() {     long long n;     cin >> n;     vector<long long> v(n);     set<long long> s1;     for (long long i = 0; i < n; i++) {       cin >> v[i];       if (s1.find(v[i]) != s1.end() && s1.size() > 1) {         cout << 0 <<   n ;         return;       }       s1.insert(v[i]);     }     if (n == 1) {       cout << -1 <<   n ;       return;     }     if (s1.size() == 1) {       cout << 1 <<   n ;       cout << v[0] <<   n ;       return;     }     sort(v.begin(), v.end());     set<long long> s2;     unordered_map<long long, long long> amp;     long long d = 0;     long long d2 = INT_MAX;     for (long long i = 1; i < n; i++) {       s2.insert(v[i] - v[i - 1]);       amp[v[i] - v[i - 1]]++;       ;       d = ((d) > (v[i] - v[i - 1]) ? (d) : (v[i] - v[i - 1]));       d2 = ((d2) < (v[i] - v[i - 1]) ? (d2) : (v[i] - v[i - 1]));     }     if (s2.size() > 2) {       cout << 0;       return;     }     if (s2.size() == 1) {       if (n == 2 && d / 2 == double(d) / 2) {         vector<long long> ans;         ans.push_back(v[0] - d);         ans.push_back(v[n - 1] + d);         ans.push_back(v[0] + d / 2);         sort(ans.begin(), ans.end());         cout << ans.size() <<   n ;         cout << ans[0] <<     << ans[1] <<     << ans[2];         return;       }       cout << 2 <<   n ;       cout << v[0] - d <<     << v[n - 1] + d;       return;     }     if (amp[d] > 1) {       cout << 0 <<   n ;       return;     }     for (long long i = 1; i < n; i++) {       if (v[i] - v[i - 1] == d && (double)d / 2 == d2) {         cout << 1 <<   n ;         cout << v[i - 1] + d2 <<   n ;         return;       }     }     cout << 0 <<   n ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long l = 1;     while (l--) {       solve();     }     return 0;   }   