#include "bits/stdc++.h"
#include "partition.h"
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mod 1000000007
#define N 24
#define maxn 200005

ll sm=0,answer=1e9;
vector<pair<int,int> > v;

std::vector<int> solve(std::vector<int> A) {
	answer=1e9;
	v.clear();
	sm=0;
	ll sum=0,sum1=0,id=0;
	for(int i=0; i<A.size(); i++)v.pb({A[i],i}),sm+=A[i];
	sum1=sm;
	sm=sm/2+sm%2;
	sort(v.begin(),v.end());
	vector<int> aa;
	pair<int,int> aq={-1,-1};
	int n=v.size();
	for(int i=0; i<v.size(); i++){
		sum+=v[i].ff;
		if(sum>=sm)break;
		while(id<n and sum1+sum>=sm){
			sum1-=v[id].ff;
			id++;
		}
		if(abs(n-2*(i+1+n-id+1))<answer){
			answer=abs(n-2*(i+1+n-id+1));
			aq={i,id-1};
			// cout<<answer<<' '<<i<<' '<<id<<'\n';
		}
	}
	// cout<<aq.ff<<' '<<aq.ss<<'\n';
	for(int i=0; i<=aq.ff; i++)aa.pb(v[i].ss);
	for(int i=aq.ss; i<n; i++)aa.pb(v[i].ss);
	for(int i=aq.ff+1; i<aq.ss; i++)aa.pb(v[i].ss);
	return aa;
}