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

const int MAXN=2*1e7;
int n, p=0;
int x, y, k;
vector<int> ans;

vector<int> solve(vector<int> a)
{
    x=0;
    y=0;
    p=0;
    n=a.size();
    ans.assign(n, 0);
    int k=n/2;
    if(n%2==1)
    {
        k++;
    }
    for(int i=0; i<k; i++)
    {
        if(i==k-1 && (n/2)%2==1 && n%2==0)
        {
            ans[x]=i;
            ans[k+y]=i+1;
            return ans;
        }
        if(i%2==0)
        {
            if(i==(n-i-1))
            {
                ans[x]=i;
                x++;
            }
            ans[x]=i;
            x++;
            ans[x]=n-i-1;
            x++;
        }
        else
        {
            ans[k+y]=i;
            y++;
            ans[k+y]=n-i-1;
            y++;
        }
    }
    return ans;
}
