#include<bits/stdc++.h>
using namespace std;


int n,m,k,a[10000000];

int main()
{
	
	freopen("meow.in","r",stdin);
	freopen("meow.out","w",stdout);
	
	int t;
	cin>>t;
	while(t--)
	{
		cin>>n>>m>>k;
		for(int i=1;i<=m;i++)
		{
			cin>>a[i];
		}
		cout<<m<<endl;
		for(int i=1;i<=m;i++)
		{
			cout<<1<<" "<<1<<endl;
		}
	}
	
	return 0;
}
