#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define N 5005
int n, ans[N];
int main()
{
	int T;
	scanf("%d", &T);
	while (T--)
	{
		scanf("%d", &n);
		int lst = 0, res = 0;
		for (int i = 2; i <= n; i++)
		{
			printf("? 1 %d\n", i - 1);
			printf("%d\n", i);
			for (int j = 1; j < i; j++)
				printf("%d%c", j, j == i - 1 ? 10 : 32);
			fflush(stdout);
			scanf("%d", &res);
			if (res)
			{
				lst = i;
				break;
			}
		}
		int l = 1, r = lst - 1;
		while (l < r)
		{
			int mid = (l + r) >> 1;
			printf("? 1 %d\n", mid - l + 1);
			printf("%d\n", lst);
			for (int j = l; j <= mid; j++)
				printf("%d%c", j, j == mid ? 10 : 32);
			fflush(stdout);
			scanf("%d", &res);
			if (res)
				r = mid;
			else
				l = mid + 1;
		}
		int sum = 0;
		for (int i = 1; i < lst; i++)
			if (i != l)
				ans[++sum] = i;
		for (int i = lst + 1; i <= n; i++)
		{
			printf("? 1 1\n");
			printf("%d\n%d\n", lst, i);
			fflush(stdout);
			scanf("%d", &res);
			if (!res)
				ans[++sum] = i;
		}
		printf("! %d", sum);
		for (int i = 1; i <= sum; i++)
			printf(" %d", ans[i]);
		putchar(10);
		fflush(stdout);
	}
}
