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



vector<int> solve(vector<int> A) {
    vector <pair <int, int>> v;
    vector <int> ans;
    int sum = 0, sumA = 0;
    for (int i = 0; i < A.size(); i ++) {
        v.push_back({A[i], i});
        sum += A[i];
    }

    sort(v.begin(), v.end());
    for (int i = v.size() - 1; i >= 0; i --) {
        ans.push_back(v[i].second);
    }

    for (int i = 0; i < ans.size(); i ++) {
        sumA += A[ans[i]];
        if (sumA >= 1.0 * sum / 2) {
            break;
        }
    }

    // cout << sumA << " " << sum << " " << abs((sum - sumA) - sumA) << endl;

    return ans;
}