#include <bits/stdc++.h>
#define pii pair<int, int>
#define f first
#define s second
#define ll long long
#define oo 1000000000
#define piii pair<pii, int>
#define pb push_back

using namespace std;

int ask(pii l, pii r) {
    cout << "? " << l.s - l.f + 1 << " " << r.s - r.f + 1 << '\n';
    for(int i = l.f; i <= l.s; ++i) {
        cout << i << " ";
    }
    cout << '\n';
    for(int i = r.f; i <= r.s; ++i) {
        cout << i << " ";
    }
    cout << '\n';
    fflush(stdout);
    int res;
    cin >> res;
    return res;
}
void solve() {
    int n;
    cin >> n;
    vector<char>magnit_state(n + 1, '0');
    pii l, r;
    l.f = l.s = 1;
    r.f = 2, r.s = n;
    int res = ask(l, r);
    while(res == 0) {
        l.f = l.s = r.f;
        r.f++;
        res = ask(l, r);
    }
    magnit_state[l.f] = '?';
    int res2;
    while(r.f < r.s) {
        r.f++;
        res2 = ask(l, r);
        if(res2 != res) {
            magnit_state[r.f - 1] = '?';
            res = res2;
        }
    }
    if(res != 0) {
        magnit_state[r.f] = '?';
    }
    /// There is at most one non-demagnetized from 1 to (l.f - 1), perform bs
    int low = 1, high = l.f - 1;
    int mid, pos = -1;
    while(low <= high) {
        mid = (low + high) / 2;
        if(ask(l, {1, mid}) == 0) {
            low = mid + 1;
        }else {
            high = mid - 1;
            pos = mid;
        }
    }
    if(pos != -1) {
        magnit_state[pos] = '?';
    }
    vector<int>demagnetized;
    for(int i = 1; i <= n; ++i) {
        if(magnit_state[i] == '0') {
            demagnetized.pb(i);
        }
    }
    cout << "! " << (int)demagnetized.size();
    for(int m : demagnetized) {
        cout << " " << m;
    }
    cout << '\n';
    fflush(stdout);
}
int main()
{
    int t;
    cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}