#include<bits/stdc++.h>
#include "partition.h"
using namespace std;
std::vector<int> solve(std::vector<int> A) {
   int N = (int)A.size();
   vector<int> o(N);
   iota(o.begin() , o.end() , 0);
   sort(o.begin() , o.end() , [&](int i , int j){
      return A[i] > A[j];
   });

   vector<int> ans;
   for(int i = 0;i < N;i += 2){
      ans.emplace_back(o[i]);
   }
   reverse(ans.begin() , ans.end());
   for(int i = 1;i < N;i += 2){
      ans.emplace_back(o[i]);
   }
   return ans;
}