func_code_string: #include <bits/stdc++.h>   using namespace std;   void magic(int n) {     int cnt = 0;     set<vector<vector<int>>> s;     vector<pair<int, string>> ans;     map<int, int> mp;     function<void(vector<vector<int>>)> f = [&](const vector<vector<int>> &x) {       if (s.find(x) != s.end()) return;       s.insert(x);       if (x.size() == 1) {         ++cnt;         ans.push_back({0,   });         for (auto &i : x)           for (auto j : i) {             ans.back().second.push_back( 0  + j);             ans.back().first += j;           }         return;       }       for (size_t i = 1; i < x.size(); ++i) {         vector<vector<int>> y = x;         y.erase(y.begin() + i);         for (auto &z : x[i]) y[i - 1].push_back(z);         for (auto &z : y[i - 1]) z ^= 1;         f(y);       }     };     vector<vector<int>> a(n, vector<int>(1, 1));     f(a);     cout << cnt <<   n ;     sort(ans.begin(), ans.end());     for (auto i : ans) {       cout << i.first <<     << i.second <<   n ;       ++mp[i.first];     }     for (auto i : mp) {       cout << i.first <<     << i.second <<   n ;     }   }   void brute(vector<long long> a) {     long long ans = numeric_limits<long long>::min();     set<vector<long long>> s;     function<void(vector<long long>)> f = [&](const vector<long long> &x) {       if (x.size() == 1) {         ans = max(ans, x[0]);         return;       }       if (s.find(x) != s.end()) return;       s.insert(x);       for (size_t i = 1; i < x.size(); ++i) {         vector<long long> y = x;         y.erase(y.begin() + i);         y[i - 1] = -x[i - 1] - x[i];         f(y);       }     };     f(a);     cout << ans <<   n ;   }   int main() {     ios_base::sync_with_stdio(0), cin.tie(0);     int n;     cin >> n;     vector<pair<long long, int>> a(n);     for (auto &i : a) cin >> i.first, i.second = &i - &a[0];     long long sum = 0;     for (auto i : a) sum += -i.first;     for (auto &i : a) i.first *= 2;     sort(a.rbegin(), a.rend());     int t = n % 3;     if (t == 2)       t = 0;     else if (t == 0)       t = 2;     a.insert(a.begin(), {0, 0});     for (int i = 1; i <= n; ++i) a[i].first += a[i - 1].first;     auto get = [&](int p) { return a[p].first - a[p - 1].first; };     long long rans = numeric_limits<long long>::min();     for (; t <= n; t += 3) {       if (n > 1 && (n & 1) && t == (n + 1) / 2) {         bool bad = true;         for (int i = 1; i <= t; ++i) bad &= ~a[i].second & 1;         rans = max(rans, sum + a[t].first + bad * (-get(t) + get(t + 1)));       } else         rans = max(rans, sum + a[t].first);     }     cout << rans <<   n ;     return 0;   }   