#include<bits/stdc++.h>

using namespace std;

const int N = 2000 + 10;

int n;
bool flag[N];

bool Query(int l1, int r1, int l2, int r2) {
	printf("? %d %d\n", r1 - l1 + 1, r2 - l2 + 1);
	for (int i = l1; i <= r1; i++)	printf("%d%c", i, " \n"[i == r1]);
	for (int i = l2; i <= r2; i++)	printf("%d%c", i, " \n"[i == r2]);
	fflush(stdout);
	int res;	scanf("%d", &res);
	return res;
}

void Solve() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)	flag[i] = 0;
	for (int i = 2; i <= n; i++) {
		if (Query(1, i - 1, i, i)) {
			// printf("i = %d\n", i);
			flag[i] = 1;
			for (int j = i + 1; j <= n; j++) {
				if (Query(i, i, j, j)) {
					flag[j] = 1;
				}
			}
			int L = 1, R = i - 1, ans = 0;
			while (L <= R) {
				// printf("L = %d, R = %d\n", L, R);
				int M = (L + R) >> 1;
				if (Query(1, M, i, i))	R = M - 1, ans = M;
				else	L = M + 1;
			}
			// printf("ans = %d\n", ans);
			flag[ans] = 1;
			break;
		}
	}
	// puts("ans");
	// for (int i = 1; i <= n; i++) {

	// }
	vector <int> ans;
	for (int i = 1; i <= n; i++) {
		if (!flag[i]) {
			ans.push_back(i);
		}
	}
	printf("! %d\n", ans.size());
	for (auto x : ans) {
		printf("%d ", x);
	} puts("");
	fflush(stdout);
}

int main(){
    srand(time(0));
#ifndef ONLINE_JUDGE
    // freopen("data.in", "r", stdin);
    // freopen("tst.out", "w", stdout);
    clock_t st = clock();
#endif
    int T = 1;
	scanf("%d", &T);
    while (T--) {
		Solve();
    }
#ifndef ONLINE_JUDGE
    clock_t ed = clock();
    printf("time : %.6lfs\n", 1.0 * (ed - st) / CLOCKS_PER_SEC);
#endif
    return 0;
}
