#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> PII;

const int N = 2e5 + 10;

int main()
{
	auto ask = [&] (vector<int> &a, vector<int> &b) -> int
	{
		printf("? %d %d\n", (int)a.size(), (int)b.size());
		for (auto x: a) printf("%d ", x); printf("\n");
		for (auto x: b) printf("%d ", x); printf("\n");
		fflush(stdout);
		int val; scanf("%d", &val);
		return val;
	};
	
	int t; scanf("%d", &t);
	while (t--)
	{
		int n; scanf("%d", &n);
		vector<int> a, b(1);
		vector<int> mag;
		a.emplace_back(1);
		for (int i = 2; i <= n; i++)
		{
			b[0] = i;
			int val = ask(a, b);
			if (val)
			{
				mag.emplace_back(i);
				break;
			}
			else a.emplace_back(i);
		}
		for (int i = mag[0] + 1; i <= n; i++)
		{
			b[0] = i;
			int val = ask(a, b);
			if (val) mag.emplace_back(i);
		}
		
		int l = 0, r = (int)a.size() - 1;
		while (l < r)
		{
			int mid = l + r >> 1;
			vector<int> v;
			for (int i = 0; i <= mid; i++)
				v.emplace_back(a[i]);
			b[0] = mag.back();
			int val = ask(v, b);
			if (val) r = mid;
			else l = mid + 1;
		}
		mag.emplace_back(a[r]);
		
		vector<int> vis(n + 1, 0);
		for (auto x: mag) vis[x] = 1;
		vector<int> ans;
		for (int i = 1; i <= n; i++)
			if (!vis[i]) ans.emplace_back(i);
		printf("! %d", (int)ans.size());
		for (auto x: ans) printf(" %d", x);
		printf("\n");
		fflush(stdout);
	}
	
	return 0;
}