#include "partition.h"
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
std::vector<int> solve(std::vector<int> A)
{
    vector<int>ans,other;

    int n=A.size();

    vector<pair<int,int>>pairs;
    int l=0,r=n-1;
    while(l<r)
    {
        pairs.push_back({l,r});l++;r--;
    }

    for(int i=0;i<pairs.size();i++)
    {
        if(i%2==0){other.push_back(pairs[i].first);other.push_back(pairs[i].second);}
        else {ans.push_back(pairs[i].first);ans.push_back(pairs[i].second);}
    }

    if(l==r)ans.push_back(l);

    for(int x:other)ans.push_back(x);
    return ans;
}
