#include <bits/stdc++.h>
#include "partition.h"

using namespace std;

vector<int> solve(vector<int> A)
{
    vector<int> ans;
    int st, mn, n;
    st = mn = 0;
    n = A.size();
    if(n % 2 != 0)
    {
        st = 1;
        ans.push_back(0);
    }
    if((n - st) % 4 != 0)
    {
        mn = 1;
        ans.push_back(n / 2 - 1 + st);
    }
    for(int i = st; i < n / 2 - mn; i += 2)
    {
        ans.push_back(i);
        ans.push_back(n - i - 1 + st);
    }
    for(int i = st + 1; i < n / 2 - mn; i += 2)
    {
        ans.push_back(i);
        ans.push_back(n - i - 1 + st);
    }
    if(mn == 1)
        ans.push_back(n / 2 + st);
    return ans;
}
