#define ll long long

#include "partition.h"
#include<bits/stdc++.h>
using namespace std;

const ll MAXN=2e6+3;
ll n;
pair<ll,ll> a[MAXN];


vector<int> solve(vector<int> A)
{
    n=A.size();
    for(ll i=0;i<n;i++){
        a[i].first=A[i];
        a[i].second=i;
    }

    sort(a,a+n);
    ll l=0,r=n-1;
    vector<int> ans(n,0);
    for(ll i=0;i<n;i++){
        if(i%2==0){
            ans[l]=a[i].second;
            l++;
        }
        else{
            ans[r]=a[i].second;
            r--;
        }
    }

    return ans;
}
