#include <bits/stdc++.h>

using namespace std;
#define rep(i, l, r) for(auto i=(l);i<=(r);++i)

inline int ask(int l1, int r1, int l2, int r2) {
    printf("? %d %d\n", r1 - l1 + 1, r2 - l2 + 1);
    rep(i, l1, r1)printf("%d ", i);
    puts("");
    rep(i, l2, r2)printf("%d ", i);
    puts("");
    fflush(stdout);
    int res;
    scanf("%d", &res);
    return res;
}

int n;
vector<int> q;

inline void work1(int pos) {
    int l = 1, r = pos - 1;
    while (l <= r) {
        int m = l + r >> 1;
        int o = ask(l, m, m + 1, pos);
        if (o != 0)r = m - 1;
        else l = m + 1;
    }
    rep(i, 1, pos - 1) {
        if (l != pos && i == (r + 1))continue;
        q.push_back(i);
    }
}

inline void work2(int pos) {
    rep(i, pos + 1, n)if (ask(pos, pos, i, i) == 0)q.push_back(i);
}

inline void solve() {
    scanf("%d", &n), q.clear();
    rep(i, 1, n - 1) {
        int res = ask(1, i, i + 1, i + 1);
        if (res != 0) {
            work1(i + 1), work2(i + 1);
            break;
        }
    }
    printf("! %d", q.size());
    for (auto v:q)printf(" %d", v);
    puts("");
    fflush(stdout);
}

int main() {
    int T = 1;
    scanf("%d", &T);
    while (T--)solve();
}