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

std::vector<int> solve(std::vector<int> a) {
    vector<pair<int,int>>v(a.size());
    for ( int i = 0 , n = a.size() ; i < n ; ++ i )
        v[i]=make_pair(a[i],i);
    sort(v.begin(),v.end());
    vector<int>r;
    for ( int i = 0 , n = a.size() ; i < n ; i += 2 ) r.push_back(v[i].second);
    for ( int i = 1 , n = a.size() ; i < n ; i += 2 ) r.push_back(v[i].second);
    return r ;
}

