#include "partition.h"
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<utility>
#include<queue>
#include<map>
//#define int long long
#define ff first
#define ss second
#define pb push_back
#define pp pop_back
#define all(x) x.begin(),x.end();
#define pii pair<int,int>
using namespace std;
const int N = 5 * 1e7 + 5;
int n,m,k,l;
int fix[N];
vector <int> g[N];
vector <int> ans;
std::vector<int> solve(std::vector<int> A) {
    n = A.size();
    int mx = -1;
    for (int i = 0; i < n; i++) {
        fix[A[i]]++;
        g[A[i]].pb(i);
        mx = max(mx,A[i]);
    }
    for (int i = 0; i <= mx; i++) {
        if (fix[i] >= 1) {
            for (int j = 0; j < (g[i].size() / 2) ; j++) {
                ans.pb(g[i][j]);
            }
        }
    }
    for (int i = 0; i <= mx; i++) {
        if (fix[i] >= 1) {
            for (int j = (g[i].size() / 2); j < g[i].size(); j++) {
                ans.pb(g[i][j]);
            }
        }
    }
    return {ans};
}
