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

std::vector<int> solve(std::vector<int> a) {
    int n = a.size();
    vector<int> ans(n);
    int k = 0;
    for (int i = 0; i < n; i += 2) {
        ans[i] = k++;
    }
    k = n - 1;
    for (int i = 1; i < n; i += 2) {
        ans[i] = k--;
    }
    return ans;
}