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

inline int read()
{
	int x = 0, f = 1;
	char ch = getchar();
	while(ch < '0' || ch > '9')
	{
		if(ch == '-') f = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9')
	{
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	return x * f;
}

int t, n, m, k;

int a[305];

int main()
{
	freopen("meow.in", "r", stdin);
	freopen("meow.out", "w", stdout);
	t = read();
	while(t --)
	{
		int n = read(), m = read(), k = read();
		for(int i = 1; i <= n; ++ i ) a[i] = read();
		cout << m << endl;
		for(int i = 1; i <= m; ++ i ) cout << "1 1" << endl;
		//It makes no difference to grade.
	}	
	fclose(stdin);
	fclose(stdout);
	return 0;
}
/*
     Away from OI 
	 17/09/01 - 22/11/26
	 (Actually, 17/09 - 21/04/18 & 22/05/06 - 22/11/26, just 4 years)
	 Thanks for every OI teachers, like lele, qiuqiu, hbl, ywf, wildflower, potato..and so on.
	 Good Luck to me
	 Go back to whk
	 (Maybe Mine_king will search it, haha)
*/