#include <bits/stdc++.h>
using namespace std;

//.define
// #define FILE_IN_OUT
#define RET(_x) cout << (_x) << '\n'; return;
#define all(_obj) (_obj).begin(), (_obj).end()
#define loop(_n) for (int i = 0; i < (_n); ++i)
#define sz(_obj) static_cast<int>((_obj).size())
#ifdef SHJ_LOCAL
#define debug(_x) std::cerr << (#_x) << " = " << (_x) << '\n' << std::flush;
#else
#define debug(_x) {}
#endif
#define endl "\n"
template <typename P, typename Q>
P CeilDiv(P _dividend, Q _divider) {
    return static_cast<P>((_dividend - 1LL + _divider) / _divider);
}
template <typename Tp>
inline void outarr(Tp _begin, Tp _end, const char* _delim = " ") {
    for (Tp current = _begin; current != _end; ++current) {
        std::cout << *current << _delim;
    }
    std::cout << '\n';
}

//.constant
using ll = int64_t;
using pii = std::pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr int MOD = static_cast<int>(1e9 + 7);

//.data
bool 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 << ' ';
    }
    cout << endl;
    for (int i = l2; i <= r2; ++i) {
        cout << i << ' ';
    }
    cout << endl << flush;
    int res;
    cin >> res;
    return res;
}

//.code
void SolveTask() {
    int n;
    cin >> n;
    int j = -1;
    for (int i = 2; i <= n; ++i) {
        if (Ask(1, i - 1, i, i)) {
            j = i;
            break;
        }
    }
    vector<int> ans;
    for (int i = j + 1; i <= n; ++i) {
        if (!Ask(j, j, i, i)) {
            ans.push_back(i);
        }
    }
    int l = 1;
    int r = j - 1;
    while (l <= r) {
        int mid = (l + r) >> 1;
        if (Ask(1, mid, j, j)) {
            r = mid - 1;
        } else {
            l = mid + 1;
        }
    }
    for (int i = 1; i <= r; ++i) {
        ans.push_back(i);
    }
    for (int i = r + 2; i < j; ++i) {
        ans.push_back(i);
    }
    cout << "! " << sz(ans) << ' ';
    outarr(all(ans));
    cout << flush;
}

int main() {
#ifdef FILE_IN_OUT
    std::ifstream cin("input.txt", std::ios::in);
    std::ofstream cout("output.txt", std::ios::out);
#else
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
#endif
    int test_cases = 1;
    cin >> test_cases;
    for (int yt = 1; yt <= test_cases; ++yt) {
        SolveTask();
    }
#ifdef FILE_IN_OUT
    cin.close();
    cout.close();
#endif
    return 0;
}