#include "partition.h"
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <unordered_map>
#include <utility>
using namespace std;

std::vector<int> solve(std::vector<int> A) {
	vector<int> ans;
	int pairCount = A.size() / 2;
	if (A.size() % 2 == 0) {
		for (int i = 0; i < A.size() / 2; i++) {
			ans.push_back(A.size() - i - 1);
			ans.push_back(i);
		}
	} else {
		for (int i = 0; i < A.size() / 2; i++) {
			ans.push_back(A.size() - i - 1);
			if (pairCount % 2 == 1 && i == pairCount / 2) {
				ans.push_back(A.size() / 2);
			}
			ans.push_back(i);
			if (pairCount % 2 == 0 && i == pairCount / 2 - 1) {
				ans.push_back(A.size() / 2);
			}
		}
	}
	return ans;
}
