#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

const int maxn = 1e5 + 10;

int interact(vector<int>&& a, vector<int>&& b) {
    if (!a.size() || !b.size()) return 0;
    printf("? %d %d\n", (int)a.size(), (int)b.size());
    for (int i : a) printf("%d ", i);
    puts("");
    for (int i : b) printf("%d ", i);
    puts("");
    fflush(stdout);
    int res = 0;
    scanf("%d", &res);
    return res;
}

void solve() {
    int n;
    scanf("%d", &n);
    int idx = -1, sum = 0;
    for (int i = 2; i <= n; i++) {
        vector<int> r;
        for (int j = 1; j < i; j++) r.push_back(j);
        int val = interact({i}, move(r));
        if (val) {
            sum = val;
            idx = i;
            break;
        }
    }
    assert(idx >= 1);
    bool flag = 1;
    vector<int> tmp;
    for (int i = 1; i < idx; i++) tmp.push_back(i);
    vector<int> ans;
    if (flag) {
        int l = 1, r = idx - 1;
        while (l < r) {
            vector<int> a;
            int mid = (l + r) >> 1;
            for (int i = 1; i <= mid; i++) a.push_back(i);
            int val = interact(move(a), {idx});
            if (val)
                r = mid;
            else
                l = mid + 1;
        }
        for (int i = 1; i < idx; i++) if (i != l) ans.push_back(i);
    }
    else {
        for (int i = 1; i < idx; i++) ans.push_back(i);
    }
    for (int i = idx + 1; i <= n; i++) {
        int val = interact({i}, {idx});
        if (!val) ans.push_back(i);
    }
    printf("! %d ", (int)ans.size());
    for (int i : ans) printf("%d ", i);
    puts("");
    fflush(stdout);
}

int main() {
    int t;
    cin >> t;
    while (t--) solve();
}