#include "partition.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<int> solve(vector<int> A){
    vector<pair<int,int> >B;
    for(int i=0;i<A.size();i++){
        B.push_back({A[i],i});
    }
    sort(B.begin(),B.end());
    vector<int>anss;
    anss.clear();
    int n=B.size();
    for(ll j=0;j<n/2;j++){
        anss.push_back(B[j].second);
        anss.push_back(B[n-1-j].second);
        // cout<<j<<' '<<B[j].second<<endl;
    }
    if(n%2==1) anss.push_back(B[n/2].second);
    return anss;
}