func_code_string: #include <bits/stdc++.h>   using namespace std;   const int M = 100500;   vector<int> a, b, diff, c;   int cnt[220000];   int cnt1[220000];   int cnt3[220000];   int cntt[220000];   int cntt2[220000];   int cntt3[220000];   int cnt2[220000];   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int n;     cin >> n;     for (int i = 0; i < n; i++) {       int x;       cin >> x;       cnt[x + M]++;       cntt[x + M]++;       a.push_back(x);       diff.push_back(x + M);     }     sort(a.begin(), a.end());     sort(diff.begin(), diff.end());     diff.resize(unique(diff.begin(), diff.end()) - diff.begin());     if (diff.size() == 1 || (diff.size() == 2 && abs(diff[0] - diff[1]) == 1)) {       cout << n << endl;       for (int i = 0; i < a.size(); i++) cout << a[i] <<    ;       return 0;     } else if (diff.size() == 2 && abs(diff[0] - diff[1]) == 2) {       diff.push_back(a[0] + 1 + M);       sort(diff.begin(), diff.end());     }     while (cnt[diff[0]] > 0 && cnt[diff[2]] > 0) {       cnt[diff[0]]--;       cnt[diff[2]]--;       cnt2[diff[1]] += 2;     }     cnt2[diff[1]] += cntt[diff[1]];     for (int i = 0; i < cnt2[diff[1]]; i++) b.push_back(diff[1] - M);     for (int i = 0; i < cnt[diff[2]]; i++) b.push_back(diff[2] - M);     for (int i = 0; i < cnt[diff[0]]; i++) b.push_back(diff[0] - M);     for (int i = 0; i < b.size(); i++) cntt2[b[i] + M]++;     int ans1 = 0;     for (int i = 0; i < diff.size(); i++)       ans1 += min(cntt2[diff[i]], cntt[diff[i]]);     while (cnt[diff[1]] >= 2) {       cnt1[diff[0]]++;       cnt3[diff[2]]++;       cnt[diff[1]] -= 2;     }     cnt1[diff[0]] += cntt[diff[0]];     cnt3[diff[2]] += cntt[diff[2]];     for (int i = 0; i < cnt1[diff[0]]; i++) c.push_back(diff[0] - M);     for (int i = 0; i < cnt[diff[1]]; i++) c.push_back(diff[1] - M);     for (int i = 0; i < cnt3[diff[2]]; i++) c.push_back(diff[2] - M);     for (int i = 0; i < c.size(); i++) cntt3[c[i] + M]++;     int ans2 = 0;     for (int i = 0; i < diff.size(); i++)       ans2 += min(cntt3[diff[i]], cntt[diff[i]]);     if (ans1 < ans2) {       cout << ans1 << endl;       for (int i = 0; i < b.size(); i++) cout << b[i] <<    ;     } else {       cout << ans2 << endl;       for (int i = 0; i < c.size(); i++) cout << c[i] <<    ;     }     return 0;   }   