#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> w(n);
    for (int i = 0; i < n; i++) cin >> w[i];
    map<int, int> mp;
    for (auto x : w) mp[x]++;
    int ans = 0;
    for (int s = 0; s <= 100; s++) {
      map<int, int> cnt = mp;
      int res = 0;
      for (int i = 0; i < n; i++) {
        if (cnt[w[i]] == 0) continue;
        if ((s - w[i] != w[i] && cnt[s - w[i]] > 0) ||
            (s - w[i] == w[i] && cnt[s - w[i]] >= 2)) {
          cnt[w[i]]--;
          cnt[s - w[i]]--;
          res++;
        }
      }
      ans = max(ans, res);
    }
    cout << ans << "\n";
  }
}
