#include <bits/stdc++.h>
#include "partition.h"

#define pb push_back
#define sz(x) (ll)x.size()
#define pw(x) ((1LL)<<(x))
#define all(x) x.begin(), x.end()

using ll = int;
using ld = long double;

using namespace std;

vector<int> solve(vector<int> A){
    vector<ll> a = A;
    ll n = sz(a);
    ll i, j;
    vector<pair<ll,ll>> p;
    for (i=0;i<n;i++){
        p.pb({a[i],i});
    }
    sort(all(p));
    reverse(all(p));
//    vector<ll> left, right;
//    ll suma=0, sumb=0;
//    for (i=0;i<n;i++){
//        if (suma<=sumb){
//            suma+=p[i].first;
//            left.pb(p[i].second);
//        }else sumb+=p[i].first, right.pb(p[i].second);
//    }
    vector<ll> ans;
    for (auto [_,y] : p){
        ans.pb(y);
    }
//    for (auto x : left) ans.pb(x);
//    for (auto x : right) ans.pb(x);
    return ans;
}