// bog da pazi gospod, tova bi trqvwalo da e puvata podzadacha

#include "partition.h"

#include<algorithm>
using namespace std;
std::vector<int> solve(std::vector<int> A) {
    int n = A.size();
    vector<pair<int,int>> B;
    for(int i = 0; i < n; ++i){
        B.push_back({A[i], i});
    }
    sort(B.begin(), B.end(), [](pair<int, int> one, pair<int,int> two){
            return one.first < two.first;
        });
    vector<int> ans;
    for(int i = 0; i < n; i += 2){
        ans.push_back(B[i].second);
    }
    for(int i = 1; i < n; i += 2){
        ans.push_back(B[i].second);
    }
    return ans;
}
