#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
using namespace std;
const int MAXM=2e6+5,MAXN=305;
int t ,n,m,k;
int a[MAXN],bas[MAXN],id[MAXN];
bool big[MAXM];
void read(int &x)
{
	char ch=getchar();
	x=0;
	int f =1;
	while (ch>'9' || ch<'0')
	{
		if ( ch=='-')
			f=-1;
		ch=getchar();
	}
	while (ch<='9' && ch>='0')
	{
		x=(x<<3)+(x<<1)+ch-'0';
		ch=getchar();
	}
	x*=f;
}
int main()
{
	freopen("meow.in","r",stdin);
	freopen("meow.out","w",stdout);
	read(t);
	//printf("%d\n",t);
	for (int i=1;i<=t;i++)
	{
		read(n),read(m),read(k);
		for (int i=1;i<=k;i++)
			bas[i]=0;
		int cnt_node=0;
		for (int i=1;i<=n;i++)
		{
			read(a[i]);
			if (!bas[a[i]])
				id[a[i]]=++cnt_node;
			bas[a[i]]++;
		}
	}
}