    #include "partition.h"
    #include <bits/stdc++.h>
    #define ll long long
    #define pii pair<int,int>
    #define pll pair<ll,ll>
    #define fi first
    #define sc second
    #define pb push_back
    #define all(x) (x).begin(),(x).end()

    using namespace std;

    const int MAXN = 2e5;
    const ll inf = 1e18;
    const int MAXV = (3e7) + 5;

    std::vector<int> solve(std::vector<int> A) {
        ll sum = 0;
        int n = (int)A.size();
        deque<int> dq;
        unordered_map<int,int> cnt;
        vector<int> rez;
        for(int i=0; i<n; i++)sum+=A[i], cnt[A[i]]++;
        ll goal = (sum+1)/2;
        vector<pll> niz(n);
        vector<pll> bestniz;
        int mnraz = n;
        for(int i=0; i<n; i++)niz[i].fi = A[i], niz[i].sc = i;
        sort(all(niz));
        bestniz =niz;
        do
        {
            int i = 0;
            ll trsum = 0;
            while(trsum < goal)trsum+= niz[i++].fi;
            ll trraz = abs(i - (n-i));
            if(mnraz > trraz)
            {
                mnraz = trraz;
                bestniz = niz;

            }
        }while(next_permutation(all(niz)));
        for(auto x: bestniz)rez.pb(x.sc);
        //cout << mnraz << endl;
        return rez;

    }
