#include "partition.h"
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
using namespace std;

int abs1(int x) {
    if (x < 0) return -x;
    else return x;
}

vector<int> solve(vector<int> a) {
    int n = a.size();
    vector <int> ans;
    double S = 0;
    for (int &i : a) S += i;
    S /= 2;
    int best = 0;
    for (int mask = 0; mask < (1 << n); mask++) {
        int x=0, c=0;
        for (int i = 0; i < n; i++) {
            if (mask & (1 << i)) {
                x += a[i];
                c++;
            }
        }
        if (x >= S) {
            if (abs1(n - ans.size() * 2LL) > abs(n - c - c)) {
                ans.clear();
                for (int i = 0; i < n; i++) {
                    if (mask & (1 << i)) {
                        ans.pb(i);
                    }
                }
                best = mask;
            }
        }
    }
    for (int i = 0; i < n; i++) {
        if (best & (1 << i)) {}
        else ans.pb(i);
    }
    return ans;
}
