#include "partition.h"
#include <bits/stdc++.h>

long long n,k,i,j,sum,v[100001],nr,fr[100001],p1=-1,p2=-1,rez;
std::vector<int> solve(std::vector<int> A)
{
    nr=A.size();
    for(i=0;i<=nr-1;i++)
    {
    fr[A[i]]++;
    rez=A[i];
    if(fr[A[i]]==1) p1++,swap(A[p1],A[i]);
    else p2++,swap(A[nr/2+p2],A[i]);
    }
 return A;
}

