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

const int maxn = 2005;
vector<int>pre,suf;
int ask(){
	printf("? %d %d\n",(int)pre.size(),(int)suf.size());
	for(int i=0;i<pre.size();++i)printf("%d ",pre[i]);puts("");
	for(int i=0;i<suf.size();++i)printf("%d ",suf[i]);puts("");
	fflush(stdout);
	int u;
	scanf("%d",&u);
	return u;
}
int vis[maxn];
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		int n;
		scanf("%d",&n);
		for(int i=1;i<=n;++i)vis[i]=0;
		pre.clear(),suf.clear();
		suf.push_back(2);
		int i=2;
		for(i=2;i<=n;++i){
			pre.push_back(i-1);
			suf[0]=i;
			if(ask())break;
		}
		int j=0,l=1,r=i-1;
		while(l<=r){
			int mid=l+r>>1;
			pre.clear();
			for(int i=1;i<=mid;++i)pre.push_back(i);
			if(j==mid || ask()){
				r=mid-1;
				j=mid;
			}else{
				l=mid+1;
			}
		}
		vis[i]=vis[j]=1;
		pre.clear();
		pre.push_back(j);
		for(i++;i<=n;++i){
			suf[0]=i;
			if(ask()){
				vis[i]=1;
			}
		}
		vector<int>ans;
		for(i=1;i<=n;++i)if(!vis[i])ans.push_back(i);
		printf("! %d ",(int)ans.size());
		for(int i=0;i<ans.size();++i)printf("%d ",ans[i]);puts("");
		fflush(stdout);
	}
} 