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

using namespace std;

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

