#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
int bits[50];
vector<int>rez;
std::vector<int> solve(std::vector<int> A)
{
    int n=A.size(),sum=0,minn;
    minn=n;
    for(int i=0;i<n;i++)
        sum+=A[i];
    cout<<1;
    for(int i=0; i<(1<<n); i++)
    {
        cout<<i<<'\n';
        int cnt=0,ci=i;
        for(int j=0; j<n; j++)
        {
            bits[j]=0;
            bits[j]=ci%2;
            ci/=2;
        }
        vector<int> v;
        v.clear();
        for(int j=0; j<n; j++)
            if(bits[j]!=0)
            {
                v.push_back(j);
            }
        sort(v.begin(),v.end());
        int s1=0,s2=0;
        for(int j=0;j<v.size()-1;j++)
            s1+=A[v[j]];
        s2=s1+A[v[v.size()-1]];
        if(2*s1<sum&&2*s2>sum)
        {
            int l1=v.size(),l2;
            l2=n-l1;
            if(minn<abs(l1-l2))
            {
                rez.clear();
                for(int i=0;i<v.size();i++)
                    rez.push_back(v[i]);
                for(int i=0;i<n;i++)
                {
                    if(bits[i]==0)
                        rez.push_back(i);
                }
            }
            if(minn==n%2)
                return rez;
        }
    }
    return rez;
}
