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



vector<int> solve(vector<int> a)
{
    int n = (int)a.size();
    vector<bool> visited(n + 1, false);
    int nHalf = (n + n % 2) / 2;
    vector<int> answer;

    for(int i = 0; i < (nHalf - nHalf % 2) / 2; i++)
    {
        visited[i] = true;
        answer.push_back(i);
    }

    for(int i = (n - (nHalf + nHalf % 2) / 2); i <= n; i++)
    {
        visited[i] = true;
        answer.push_back(i);
    }

     for(int i = 0; i < n; i++) if(!visited[i]) answer.push_back(i);

    return answer;
}
