#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 12, INF = 1e18 + 7;
vector<int> solve(vector<int> A) {
	int n = (int)A.size();
	int sm = n * (n + 1) / 2;
	if(sm % 2 == 1){
		sm += 1;
	}
	sm /= 2;
	int pl = n / 2;
	if(n % 2 == 1){
		pl += 1;
	}
	int cnt = 0;
	cnt = pl * (pl + 1) / 2;
	int last = n - 1;
	int st = pl - 1;
	while(cnt < sm){
		cnt += A[last];
		cnt -= A[st];
		swap(A[st], A[last]);
		st -= 1;
		last -= 1;
	}
	return A;
}
