#include <iostream>
#include <vector>
#include <map>
using namespace std;

int solve(int n, vector<int>& a) {
    map<int, int> mp;
    int ans = 0;

    for (auto x : a) {
        mp[x]++;
        ans = max(ans, mp[x]);
    }

    int odd = 0;
    map<int, int> even;

    for (auto x : a) {
        if (x & 1) {
            odd++;
        } else {
            int d = x / 2 - 1;
            even[d % 2]++;
        }
    }

    ans = max(ans, odd);

    for (auto &[x, c] : even)
        ans = max(ans, c);

    return ans;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;

    while (T--) {
        int n;
        cin >> n;

        vector<int> a(n);
        for (auto &x : a)
            cin >> x;

        cout << solve(n, a) << '\n';
    }

    return 0;
}