#include "partition.h"
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
std::vector<int> solve(std::vector<int> A) {
    int n=A.size();
    vector <int> ras;
    int m=(n+1)/2;
    long long ss=0;
    for (int i=0;i<n;++i)
        ss=ss+A[i];
    long long sss=0;
    for (int i=0;i<m;++i)
        sss=sss+A[i];
    int ok=1;
    int tt=m+n+1;
    for (int i=m;i<=tt;++i)
    {
        sss+=A[i%n]-A[(i-m)%n];
        if (ss>2*sss) {ok=0;}
        else {
            if (ok==0)
            {
                int ttt=i-m+1+n;
                for (int j=i-m+1;j<=ttt;++j)
                {
                    ras.push_back(j%n);
                }
                    return ras;
            }
        }
    }
    for (int j=0;j<n;++j)
        ras.push_back(j);
    return ras;
}