#include <vector>
#include <algorithm>
#include "partition.h"

using namespace std;

vector<int> solve(vector<int> v){
    int n=v.size();
    vector<int> s;
    s.resize(n);
    int maxim=0, maxpos;
    for(int i=0;i<n;i++){
        if(v[i]>maxim){
            maxim=v[i];
            maxpos=i;
        }
    }

    for(int i=0;i<n;i++){
        if(i==maxpos)
            s[i]=n/2-1;
        else if(i==n/2-1) s[i]=maxpos;
        else s[i]=i;
    }


    return s;
}
