#define ll long long
#define se second
#define fi first
using namespace std;
#include<utility>
#include<algorithm>
#include<vector>

const char nl = '\n';

    vector <int> solve(vector <int> a) {
        int n = a.size();
        ll s = 0;
        for (int i = 0; i < n; i++) {
            s += a[i];
        }
        ll need = s / 2 + s % 2;
        vector <int> ans;
        vector <int> us(n);
        int len = n / 2 + n % 2;
        ll cur = 0;
        ll mn = 1e18;
        int p = -1;
        for (int i = 0; i < len; i++) {
            cur += a[i];
        }
        if (cur >= need) {
            mn = cur;
            p = 0;
        }
        for (int i = 1; i + len - 1 < n; i++) {
            cur -= a[i - 1];
            cur += a[i + len - 1];
            if (cur >= need && cur < mn) {
                mn = cur;
                p = i;
            }
        }
        for (int i = p; i < p + len; i++) {
            ans.push_back(i);
        }
        int pos = 0;
        for (int i = 0; i < ans.size(); i++) {
            if (a[ans[pos]] < a[ans[i]]) {
                pos = i;
            }
        }
        swap(ans[pos], ans.back());
        for (auto it : ans) {
            us[it] = 1;
        }
        for (int i = 0; i < n; i++) {
            if (!us[i]) {
                ans.push_back(i);
            }
        }
        return ans;
    }