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

vector <pair <int, int>> v;
vector <int> ans1;
vector <int> ans2;

vector<int> solve(vector<int> A) {
    for (int i = 0; i < A.size(); i ++) {
        v.push_back({A[i], i});
    }

    sort(v.begin(), v.end());
    for (int i = 0; i < v.size(); i ++) {
        if (i % 2 == 0) {
            ans1.push_back(v[i].second);
        } else {
            ans2.push_back(v[i].second);
        }
    }

    for (int i = 0; i < ans2.size(); i ++) {
        ans1.push_back(ans2[i]);
    }

    return ans1;
}
