//#include "infection.h"
//#include <utility>
#include "partition.h"
//#include <pch.h>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <ios>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <string>

#define FASTIO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define vec vector<int>
#define pii pair<int,int>
#define vecl vector<long long>
#define sz size()
#define endl '\n'
#define pll pair<long,long>
#define ff first
#define ss second
#define pshb push_back
using ll = long long;


using namespace std;

vec solve(vec v) {
	int n = v.sz;
	ll sum = 0;
	for (int i = 0; i < n; i++)sum += v[i];
	int mn = n;
	vec ans;
	for (int i = 0; i < (1 << n); i++) {
		int qan = 0;
		ll cur = 0;
		for (int j = 0; j < n; j++) {
			if ((1 << j)&i) {
				cur += v[j];
				qan++;
			}
		}
		if (cur >= (sum + 1) / 2 && abs(qan-(n-qan))<mn) {
			mn = qan;
			ans.clear();
			for (int j = 0;j < n; j++) {
				if ((1 << j)&i)ans.pshb(j);
			}
			for (int j = 0; j < n; j++) {
				if (!((1 << j)&i))ans.pshb(j);
			}
		}
	}
	return ans;
}
