#include "partition.h"
std::vector<int> solve(std::vector<int> A) {
    sort(A.begin(), A.end());
    reverse(A.begin(), A.end());
    int sum1=A[0]; sum2=0;
    std:vector<int> red1;
    std:vector<int> red2;
    red1.push_back(A[0]);
    
    for(int i=1; i<n; 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]);
        }
        return red2;
    }
    else{
        for(int i=0; i<red2.size();i++){
            red1.push_back(red2[i]);
        }
        return red1;
    }
}
