#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define IOS ios::sync_with_stdio(false); cin.tie(0), cout.tie(0)
typedef long long LL;
const int maxn = 2e3 + 5;
const int mod = 1e9 + 7;

bool use[maxn];

inline int query(int l, int r, int pos){
    cout << "? " << r - l + 1 << " " << 1 << endl;
    for(int i = l; i <= r; i++) cout << i << " ";
    cout << endl;
    cout << pos << endl;
    cout.flush();
    cin >> pos; // x
    return pos;
}

inline void bq(int l, int r, int pos){
    if(l == r){
        use[l] = true;
        return;
    }
    int mid = (l + r) >> 1, x1;
    x1 = query(l, mid, pos);
    if(x1) bq(l, mid, pos);
    else bq(mid + 1, r, pos);
}

int main(){
    IOS;
    int t;
    cin >> t;
    while(t--){
        int n, pos = 2, x;
        cin >> n;
        int cnt = n;
        memset(use, 0, (n + 1) * sizeof(bool));
        while(true){
            x = query(1, pos - 1, pos);
            if(x){
                use[pos] = true;
                cnt -= 2;
                break;
            }
            pos++;
        }
        bq(1, pos - 1, pos);
        for(int i = pos + 1; i <= n; i++){
            x = query(i, i, pos);
            if(x){
                cnt--;
                use[i] = true;
            }
        }
        cout << "! " << cnt;
        for(int i = 1; i <= n; i++){
            if(!use[i]) cout << " " << i;
        }
        cout << endl;
        cout.flush();
    }
}

/*
2
5 2
12345
5 2
54321

 */