#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> solve(std::vector<int> A) {
    vector<int> ans[2];
    vector<pair<int, int>> v;
    for(int i = 0; i < A.size(); i++) {
        v.push_back({A[i], i});
    }
    sort(v.begin(), v.end());
    int cnt = 0;
    for(auto it : v) {
        if(cnt % 2 == 0) {
            ans[0].push_back(it.second);
        } else {
            ans[1].push_back(it.second);
        }
        cnt++;
    }
    vector<int> tot;
    for(auto it : ans[1]) tot.push_back(it);
    for(auto it : ans[0]) tot.push_back(it);
    return tot;
}
