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

std::vector<int> solve(std::vector<int> A){
    vector<int> l , r;
    vector<pair<int , int>> a;
    for(int i = 0;i<A.size();i++){
        a.push_back({A[i] , i});
    }
    sort(a.begin(), a.end());
    for(int i = 0;i<a.size();i++){
        if(i%2 == 0) l.push_back(i);
        else r.push_back(i);
    }
    vector<int> ans;
    for(int i = 0;i<l.size();i++){
        ans.push_back(l[i]);
    }
    for(int i = 0;i<r.size();i++){
        ans.push_back(r[i]);
    }
    return ans;
}

