#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;
    long long sss=0;
    for (int i=0;i<m;++i)
        sss=sss+A[i];
    ss=sss;
    for (int i=m;i<n;++i)
        ss=ss+A[i];
    int ok=1;
    for (int i=m;i<=m+n+1;++i)
    {
        sss+=A[i%n]-A[(i-m)%n];
        if (ss>2*sss) {ok=0;}
        else {
            if (ok==0)
            {
                for (int j=i-m+1;j<i-m+1+n;++j)
                {
                    ras.push_back(j%n);
                }
                return ras;
            }
        }
    }
    for (int j=0;j<n;++j)
        ras.push_back(j);
    return ras;
}