# include "partition.h"
# include <bits/stdc++.h>
# define ll long long
using namespace std;



vector<int> solve(vector<int> a)
{
    int n = (int)a.size();
    ll sum = (n * (n + 1)) / 2;
    ll current = 0;
    vector<bool> visited(n + 1, false);

    for(int i = n / 2 + n % 2 - 1; i < n; i++)
    {
        current += a[i];
        visited[i] = true;
        if(2 * current >= sum) break;
    }

    vector<int> answer;
    for(int i = 0; i < n; i++) if(visited[i]) answer.push_back(i);
    for(int i = 0; i < n; i++) if(!visited[i]) answer.push_back(i);
    return answer;
}
