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

std::vector<int> solve(std::vector<int> A)
{
    int n = A.size();

    map<int, int> pos;
    for(int i=0; i<n; i++)pos[ceil(log2(A[i]))] = i;

    if(n == 1)return {0};

    vector<int> v;

    for(int i=0; i<n/2-1; i++)v.push_back(pos[i]);
    v.push_back(pos[n-1]);

    for(int i=n/2-1; i<n-1; i++)v.push_back(pos[i]);
    return v;
}