#include <bits/stdc++.h>
#include "partition.h"
using namespace std;
using ll = int;
vector<int> solve(vector<int> a)
{
    ll tsum, minraz, ms = a.size();
    vector<int> v = a;
    vector<int> ans;
    for(ll i = 0; i < k.size(); i++)
    {
        tsum += v[i];
    }
    minraz = tsum;
    for(ll i = 0; i < v.size(); i++)
    {
        vector<int> locans1;
        vector<int> locans2;
        ll sum1 = 0, sum2 = 0;
        for(ll j = v.size() - i - 1; j >= 0; j++)
        {
            if(sum1 <= sum2)
            {
                sum1 += v[j];
                locans1.insert(locans1.begin(), j);
            }
            else
            {
                sum2 += v[j];
                locans2.insert(locans2.begin(), j);
            }
        }
        if(sum1 => sum2 && (sum1 - sum2 < minraz || (sum1 - sum2 == minraz && max(locans1.size(), locans2.size()) - min(locans1.size(), locans2.size()) < ms)))
        {
            ms = max(locans1.size(), locans2.size()) - min(locans1.size(), locans2.size());
            ans = locans1;
            ans.insert(ans.end(), locans2.begin(), locans2.end())
        }
        else if(sum2 > sum1 && (sum2 - sum1 < minraz || (sum2 - sum1 == minraz && max(locans1.size(), locans2.size()) - min(locans1.size(), locans2.size()) < ms)))
        {
            ms = max(locans1.size(), locans2.size()) - min(locans1.size(), locans2.size());
            ans = locans2;
            ans.insert(ans.end(), locans1.begin(), locans1.end())
        }
    }
    return ans;
}
