/*long long or int&the MAX_INT or MIN_INT*/
/*the size of a[]&inline*/
/*xx 396*/
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ldb;
template<class T>inline void checkmin(T &a,const T &b){if(b<a)a=b;}
template<class T>inline void checkmax(T &a,const T &b){if(b>a)a=b;}
const int maxn=2e3+10;
int T,n;
bool mag[maxn];
int ask(int l1,int r1,int l2,int r2){
	cout<<"?"<<" "<<r1-l1+1<<" "<<r2-l2+1<<endl;
	for(int i=l1;i<=r1;i++)cout<<i+1<<" ";cout<<endl;
	for(int i=l2;i<=r2;i++)cout<<i+1<<" ";cout<<endl;
	fflush(stdout);int x;cin>>x;
	return x;
}
void solve(){
	memset(mag,false,sizeof(mag));
	cin>>n;
	for(int i=1;i<n;i++){
		if(ask(i,i,0,i-1)!=0){
			int low=0,high=i,pos=i;
			while(low<high){
				int mid=(low+high)>>1;
				if(ask(i,i,0,mid)!=0)high=mid,pos=mid;
				else low=mid+1;
			}
			if(pos!=i)mag[pos]=true;mag[i]=true;
			for(int j=i+1;j<n;j++)if(ask(i,i,j,j)!=0)mag[j]=true;
			int cnt=0;
			for(int j=0;j<n;j++)if(mag[j]==false)cnt++;
			cout<<"! "<<cnt<<" ";
			for(int j=0;j<n;j++)if(mag[j]==false)cout<<j+1<<" ";cout<<endl;
			fflush(stdout);break;
		}
	}
}
int main(){
	cin>>T;
	while(T--)solve();
	return 0;
} 