#include<bits/stdc++.h>
#include"partition.h"
using namespace std;
vector<int> solve(vector<int> a){
    int n=a.size();
    vector<int> ret;
    a.push_back(-1);
    vector<pair<int,int>> v;
    for(int i=1;i<=n;i++) v.emplace_back(a[i],i);
    sort(v.begin(),v.end());
    for(int i=0;i<n;i++){
        if(i%2==1) ret.push_back(v[i].second-1);
    }
    for(int i=n-1;i>=0;i--){
        if(i%2==0) ret.push_back(v[i].second-1);
    }
    return ret;
}