#include <bits/stdc++.h>
#include "partition.h"
using namespace std;
int ma=-1;
int maxi;
vector<int>anss;
vector<int>per;
vector<int>nigger1={0};
vector<int>nigger2={0,1};
int curr_sum;
int curr_abs=INT_MAX/2;
int br;
int s;
int i;
int mini;
vector<int> solve(vector<int>a)
{
    int n=a.size();
    for(int i=0;i<n;i++)
    {
        per.push_back(i);
        s+=a[i];
    }
    while(next_permutation(per.begin(), per.end()))
    {
        while(curr_sum<s/2)
        {
            curr_sum+=a[per[i]];
            br++;
            i++;
        }
        if(abs((n-br)-br)<curr_abs)
        {
            curr_abs=abs(n-br-br);
            anss=per;
        }
        br=0;
        curr_sum=0;
        i=0;
    }
    return anss;
    
    
}
