#include "partition.h"
#include <bits/stdc++.h>
std::vector<int> solve(std::vector<int> A) {
    std::vector<int>br;
    for (int i=1;i<=A.size();i++){
        int c=A[i];
        br[c]++;
    }
    std::vector<int>brn;
    std::vector<int>rezi;
    std::vector<int>rezic;
    for (int i=1;i<=A.size();i++){
        int b=A[i];
        if (brn[b]<(br[b]/2)){
            brn[b]++;
            rezi.push_back(i);
        }
        else{
            rezic.push_back(i);
        }
    }
    std::vector<int>rezzz;
    for (int i=1;i<=A.size();i++){
        if (i<=(A.size()/2)){
            rezzz.push_back(rezi[i]);
        }
        else{
            rezzz.push_back(rezic[i-A.size()/2-1]);
        }
    }
    return {rezzz};
}