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



vector<int> solve(vector<int> A) {
    vector <int> ans;

    if (A.size() % 2 == 0) {
        for (int i = 0; i < A.size() / 2; i += 2) {
            ans.push_back(A.size() - i - 1);
            ans.push_back(i);
        }
        for (int i = 1; i < A.size() / 2; i += 2) {
            ans.push_back(i);
            ans.push_back(A.size() - i - 1);
        }
    } else {
        ans.push_back(0);
        for (int i = 1; i <= A.size() / 2; i += 2) {
            ans.push_back(i);
            ans.push_back(A.size() - i);
        }
        for (int i = 2; i <= A.size() / 2; i += 2) {
            ans.push_back(i);
            ans.push_back(A.size() - i);
        }
    }

    return ans;
}