#include<bits/stdc++.h>
using namespace std;
#define N 2005
int read(){
	int w=0,f=1;
	char c=' ';
	while(c<'0'||c>'9')f=(c=='-'?-f:f),c=getchar();
	while(c>='0'&&c<='9')w=w*10+c-'0',c=getchar();
	return w*f;
}
int T,n,ans[N],cnt;
bool vis[N];
bool check(int x){
	printf("? %d %d\n",x,1);
	for(int i=1;i<=x;i++)
		printf("%d%c",i,i==x?'\n':' ');
	printf("%d\n",ans[2]);
	fflush(stdout);
	return read()?1:0;
}
signed main(){
	T=read();
	while(T--){
		n=read(),cnt=2;
		for(int i=1;i<=n;i++)
			vis[i]=0;
		bool fl=0;
		for(int i=2;i<=n&&!fl;i++){
			printf("? %d %d\n",i-1,1);
			for(int j=1;j<i;j++)
				printf("%d%c",j,j==i-1?'\n':' ');
			printf("%d\n",i);
			fflush(stdout);
			if(read())ans[2]=i,fl=1;
		}
		int l=1,r=ans[2]-2;
		ans[1]=ans[2]-1;
		while(l<=r){
			int mid=(l+r)>>1;
			if(check(mid))ans[1]=mid,r=mid-1;
			else l=mid+1;
		}
		for(int i=ans[2]+1;i<=n;i++){
			printf("? 1 1\n%d\n%d\n",ans[2],i);
			fflush(stdout);
			if(read())ans[++cnt]=i;
		}
		for(int i=1;i<=cnt;i++)
			vis[ans[i]]=1;
		printf("! %d ",n-cnt);
		for(int i=1;i<=n;i++)
			if(!vis[i])printf("%d%c",i,i==n-cnt?'\n':' ');
		fflush(stdout);
	}
	return 0;
}