#include "partition.h"

std::vector<int> solve(std::vector<int> A) {
    std::vector<pair<int,int>> pi;
    for(int i=0;i<A.size();i++) pi.push_back({A[i],i});
    sort(pi.begin(),pi.end());
    //for(auto x:pi) cout<<x.first<<" "<<x.second<<endl;
    std::vector<int> ans;
    for(int i=0;i<A.size();i+=2) ans.push_back(pi[i].second);
    for(int i=1;i<A.size();i+=2) ans.push_back(pi[i].second);
    return ans;
}