#include<bits/stdc++.h>
#define f first
#define s second
#define ll long long
#include "partition.h"
using namespace std;
const int maxn = 2e3+10;
int n;
bool used[maxn];
vector<int> solve(vector<int> A)
{
    n=A.size();
    vector<pair<int,int>> a;
    ll sum=0;
    for(int i=0;i<n;i++)
    {
        a.push_back({A[i],i});
        sum+=A[i];
    }
    sort(a.rbegin(),a.rend());
    vector<int> idxs;
    for(int i=0;i<n;i++)
    {
        int cntr=0;
        int curr=a[i].f;
        int old=i;
        while(i<n-1 && a[i+1].f==curr) i++;
        int num=(i-old+1)/2;
        for(int j=old;j<old+num;j++)
        {
            idxs.push_back(j);
            used[j]=1;
        }

    }
    for(int i=0;i<n;i++)
    {
        if(!used[i]) idxs.push_back(i);
    }
}
