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

    if(sum1<sum2){
        for(int i=0; i<red1.size();i++){
            red2.push_back(red1[i]);
        }
        for(int 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(int i=0; i<red2.size();i++){
            red1.push_back(red2[i]);
        }
        for(int 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;
    }
}