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

vector <int> solve(vector <int> a) {
    vector <pair <int, int>> p;
    for (int i=0;i<a.size();i+=1) p.push_back({a[i], i});
    sort(p.begin(), p.end());
    vector <int> b(a.size(), 0);
    for (int i=0;i<a.size();i+=2) {
        b[i/2]=p[i].second;
        b[a.size()-1-i/2]=p[i+1].second;
    }
    return b;
}