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

using namespace std;

vector<int> solve(vector<int> a) {
    int n = a.size();
    vector<int> p;
    int mx = max_element(a.begin(), a.end()) - a.begin();
    for (int i = 0; i < n; ++i) {
        if (i != mx) {
            p.push_back(i);
        }
    }
    vector<int> ans;
    for (int i = 0; i < p.size() / 2; ++i) {
        ans.push_back(p[i]);
    }
    ans.push_back(mx);
    for (int i = p.size() / 2; i < p.size(); ++i) {
        ans.push_back(p[i]);
    }
    return ans;
}
