#include "partition.h"
#include <iostream>
#include <vector>

using namespace std;

vector<int> solve(vector<int> a) {
    int n = (int)a.size();
    long long S = 0;
    for (int i : a) S += i;

    int len = n >> 1;
    long long sum = 0;
    vector<bool> left(n);
    for (int i = 0; i < len; i++) sum += a[i], left[i] = 1;
    for (int i = 0; i < len; i++) {
        if ((sum << 1) >= S) break;
        left[i] = 0;
        left[n - i - 1] = 1;
        sum -= a[i];
        sum += a[n - i - 1];
    }
    vector<int> ans;
    for (int i = 0; i < n; i++) if (left[i]) ans.push_back(i);
    for (int i = 0; i < n; i++) if (!left[i]) ans.push_back(i);
    return ans;
}
