#include "partition.h"
#include <bits/stdc++.h>

using namespace std;

vector<int> solve(vector<int> a) {
    int n = a.size();
    vector<int> ans(a.size());
    vector<pair<int, int> > p;
    int j = 0;
    for (int l = 0, r = n - 1; r > l; ++l, --r) {
        p.push_back({l, r});
    }
    int sz1 = p.size() / 2 + (p.size() % 2);
    for (int i = 0; i < sz1; ++i) {
        ans[j++] = p[i].second;
        ans[j++] = p[i].first;
    }
    if (n % 2)
        ans[j++] = n / 2;
    for (int i = sz1; i < p.size(); ++i) {
        ans[j++] = p[i].second;
        ans[j++] = p[i].first;
    }
    return ans;
}