#include <algorithm>
#include "partition.h"
using namespace std;

vector <int> solve(vector <int> V) {
    vector <pair <int, int>> v;

    for (int i = 0; i < V.size(); i++) {
        v.push_back({V[i], i});
    }

    sort(v.begin(), v.end());

    vector <int> ans;

    for (int i = 0; i < v.size(); i++) {
        if (i % 2 == 0) ans.push_back(v[i].second);
    }

    for (int i = 0; i < v.size(); i++) {
        if (i % 2 != 0) ans.push_back(v[i].second);
    }

    return ans;
}
