#include "partition.h"
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int NMAX=2e6+505;
long long b[NMAX+505];
std::vector<int> solve(std::vector<int> A) {
    int n=A.size();
   // sort(a,a+n);
    int start=n%2;
    long long s=0;
    if (start==1) s=A[0];
    int dr=(n-1)/2;
    for (int i=0;i<n;++i)
        b[i]=A[i];
    for (int i=start;i<=(n-1)/2;++i)
    {
        s=s+b[i];
    }
    long long sum=0;
    for (int i=0;i<n;++i)
        sum=sum+b[i];
    int wow=0;
    while (true)
    {
        if (s*2>=sum) break;
        wow++;
        s=s-b[dr];
        dr--;
        s=s+b[n-wow];
    }
    vector <int> ras;
    for (int i=0;i<=dr;++i)
    {
        ras.push_back(i);
    }
    for (int i=n-wow;i<n;++i)
    {
        ras.push_back(i);
    }
    for (int i=dr+1;i<n-wow;++i)
        ras.push_back(i);
    return ras;
}

