#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#include "partition.h"
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define ll long long
using namespace std;

vector<int> solve(vector<int> a) {
    int n = a.size();
    int s = 0;
    for (int &i : a) s += i;
    s = ceil(1. * s / 2);
    vector <int> b;
    vector <int> ans;
    for (int i = n-1; i >= 0; i--) {
        if (s < a[i]) {
            b.pb(i);
        }
        else {
            ans.pb(i);
            s -= a[i];
        }
    }
    for (int &i : b) ans.pb(i);
    return ans;
}

