#include<bits/stdc++.h>
#include "partition.h"
using namespace std;
vector<int> solve(std::vector<int> A) {
    map<int, vector<int>> m;
    int n = A.size();
    for (int i = 0; i < n; i++){
        m[A[i]].push_back(i);
    }
    sort(A.begin(), A.end());
    vector<int> sol;
    int l = 0, r = n - 1;
    for (int i = 0; i < n; i += 2){
        sol.push_back(m[A[i]][0]);
    }
    for (int i = 1; i < n; i += 2){
        sol.push_back(m[A[i]][1]);
    }
    return {sol};
}
