#include "partition.h"
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

std::vector<int> solve(std::vector<int> A){
    vector <pair<int, int>> v;
    for (int i = 0; i < A.size(); i++){
        v.push_back({A[i], i});
    }
    sort(v.begin(), v.end());
    vector <int> rez;
    for (int i = 0; i < v.size(); i += 2){
        rez.push_back(v[i].second);
    }
    for (int i = 1; i < v.size(); i += 2){
        rez.push_back(v[i].second);
    }
    return rez;
}

