#include "partition.h"
#include <algorithm>
using namespace std;
std::vector<int> solve(std::vector<int> A) {
    int siz=A.size();
    vector<int> R(siz);

    int i=0, j=siz-1;
    bool bi=0;

    for (int k=0; k<siz; k++) {
        if (k+1<siz) {
            R[k]=j;
            R[k+1]=i;
            j--;
            i++;
            k++;
        }
        else {
            R[k]=i;
        }
    }

    return{R};
}
