#include<bits/stdc++.h>

#define ll long long
#define begin begin()
#define end end()
#define pb push_back
#define in insert
#define lldef ll N=0,M=0,K=0;
#define mk make_pair

using namespace std;

vector<int> solve(vector<int>A){
    ll N=A.size();
    vector<int>ANS;
    ll I=0;
    double halfsum=0.0, sum=0.0;
    vector<pair<int,int>>V;
    for(auto it:A){
        sum+=it;
        V.push_back(make_pair(it,I));
        I++;
    }
    sort(V.begin,V.end);
    ll back=0,front=0;
    for(ll i=0; i<N/2; i++){
        halfsum+=V[i].first;
        front++;
    }
    while((double)halfsum<(double)(sum/2)){
        halfsum-=V[front-1].first; front--;
        halfsum+=V[N-1-back].first; back++;
    }

    for(ll i=0; i<front; i++){
        ANS.pb(V[i].second);
    }
    for(ll i=N-1; i>N-1-back; i--){
        ANS.pb(V[i].second);
    }
    for(ll i=front; i<=N-1-back; i++){
        ANS.pb(V[i].second);
    }
    
    
}