#include <bits/stdc++.h>
#include "partition.h"
using namespace std;

const int MAXN = 2e6;

int n;
map< int , int >f;
map< int , int >f2;
vector< int >pos1 , pos2;
vector< int >solve( vector< int >a ) {
    int i , mskans , msk , j;
    long long s , sum;
    vector< int >ans;
    n = a.size();
    sum = 0;
    for( i = 0 ; i < n ; i++ )
        sum += a[i];
    int nrmin = n;
    //cout << sum << '\n';
    for( msk = 0 ; msk < ( 1 << n ) ; msk++ ) {
        s = 0;
        for( j = 0 ; ( 1 << j ) <= msk ; j++ )
            if( ( 1 << j ) & msk )
                s += a[j];
        int cnt = __builtin_popcount( msk );
        if( s >= sum / 2 && abs( cnt - ( n - cnt ) ) < nrmin ) {
            nrmin = abs( cnt - ( n - cnt ) );
            mskans = msk;
        }
    }
    for( i = 0 ; i < n ; i++ )
        if( ( 1 << i ) & mskans )
            ans.push_back( i );
    for( i = 0 ; i < n ; i++ )
        if( !( ( 1 << i ) & mskans ) )
            ans.push_back( i );
    return ans;
}
