#include "partition.h"
#include <bits/stdc++.h>
#define MAXN 2000001

using namespace std;

int n;
long long s;
double s2;

struct member
{
    int val, idx;
    member() {};
    member(int _val, int _idx)
    {
        val=_val;
        idx=_idx;
    };
    bool operator <(const member &e)const
    {
        return val<e.val;
    }
};

member a[MAXN];
vector<int>ans;

void solver()
{
    long long sum=0, br=0;
    for(int i=n-1; i>=0; i--)
    {
        if(br<n/2-1)
        {
            if(sum+a[i].val<s2)
            {
                sum+=a[i].val;
                br++;
                ans.push_back(a[i].idx);
            }
        }
        else if(br==n/2-1)
        {
            if(sum+a[i].val>=s2)
            {
                ans.push_back(a[i].idx);
                return;
            }
            else
            {
                ans.push_back(a[i].idx);
                ans.push_back(a[i-1].idx);
                return;
            }
        }

    }
}

vector<int> solve(vector<int> AA)
{
    n=AA.size();
    /*for(int i=0; i<n; i++)
    {
        a[i].val=AA[i];
        a[i].idx=i;
        s+=a[i].val;
    }
    s2=s/2;
    sort(a, a+n);*/
    //ans.push_back(n-1);
    if(n%2==0)
    {
        for(int i=0; i<n/2; i++)
        {
            ans.push_back(i);
            ans.push_back(n-i-1);
        }
    }
    else
    {
        for(int i=0; i<n/2; i++)
        {
            ans.push_back(i);
            ans.push_back(n-i-1);
        }
        ans.push_back(n/2);
    }
    return ans;
}
