#include "partition.h"
#include<bits/stdc++.h>
std::vector<int> solve(std::vector<int> A) {
    std::vector<int> AA;
    std::vector<int> AB;
    for(long long i=0; i<A.size(); i++){
        AA.push_back(A[i]);
        AB.push_back(A[i]);
    }
    sort(AB.begin(), AB.end());
    reverse(AB.begin(), AB.end());
    long long sum1=A[0], sum2=0;
    std::vector<long long> red1;
    std::vector<long long> red2;
    std::vector<int> otg;
    red1.push_back(AB[0]);
    for(long long i=1; i<AB.size(); i++){
        if(sum1>sum2){
            sum2+=AB[i];
            red2.push_back(AB[i]);
        }
        else{
            sum1+=AB[i];
            red1.push_back(AB[i]);
        }
    }

    if(sum1<sum2){
        for(long long i=0; i<red1.size();i++){
            red2.push_back(red1[i]);
        }
        for(long long i=0; i<red2.size();i++){
            for(int j=0; j<AA.size(); j++){
                if(AA[j]==red2[i]){

                    otg.push_back(j);
                    AA[j]=-1;
                    break;
                }
            }
        }
        return otg;
    }
    else{
        for(long long i=0; i<red2.size();i++){
            red1.push_back(red2[i]);
        }
        for(long long i=0; i<red1.size();i++){
            for(int j=0; j<AA.size(); j++){
                if(AA[j]==red1[i]){
                    otg.push_back(j);
                    AA[j]=-1;
                    break;
                }
            }
        }
        return otg;
    }
}
