#include <bits/stdc++.h>
#include "partition.h"

using namespace std;


vector<int> solve(vector<int> A) {
    vector<int> ans;
    vector<pair<int, int> > v;
    for(int i = 0; i < A.size(); i++){
        v.push_back({A[i], i});
    }
    sort(v.begin(), v.end());
    for(int i = 0; i < v.size(); i += 2){
        ans.push_back(v[i].second);
    }
    for(int i = 1; i < v.size(); i += 2){
        ans.push_back(v[i].second);
    }
    return ans;
}
