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

using namespace std;

std::vector<int> solve(std::vector<int> A) {
  int n = A.size();
  vector<int> v(n);
  if ( n % 2 == 0 ) {
    for ( int i = 0; i < n; i += 2 ) {
      v[i] = i / 2;
      v[i + 1] = n - i / 2 - 1;
    }
  } else {
    for ( int i = 0; i < n - 1; i += 2 ) {
      v[i] = i / 2;
      v[i + 1] = n - i / 2 - 1;
    }
    v[n - 1] = (n - 1) / 2;
  }
  return v;
}
