#include <iostream>

#include<vector>

#include<map>

#include<algorithm>

#include "partition.h"

using namespace std;

vector<int> solve(vector<int> A) {
	vector<int> sol;
	map<int, int> fr;
	bool par = true;
	for (auto x : A) {
		fr[x]++;
	}
	for (auto x : fr) {
		if (x.second % 2 == 1) par = false;
	}
	if (par == true) {
		map<int, int> aux;
		for (int i = 0; i < A.size(); ++i) {
			aux[A[i]]++;
			if (aux[A[i]] <= fr[A[i]] / 2) {
				sol.push_back(i);

			}
		}
		aux.clear();
		for (int i = 0; i < A.size(); ++i) {
			aux[A[i]]++;
			if (aux[A[i]] > fr[A[i]] / 2) {
				sol.push_back(i);
			}
		}
		return sol;
	}
	
}
