#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  map<int, int> M;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    M[x]++;
  }
  int mx = 0;
  map<int, int> W;
  for (auto it = M.begin(); it != M.end(); it++) {
    for (auto jt = it; jt != M.end(); jt++) {
      if (W.find(it->first + jt->first) != M.end())
        if (it == jt)
          W[it->first + jt->first] += min(it->second, jt->second) / 2;
        else
          W[it->first + jt->first] += min(it->second, jt->second);
      else {
        if (it == jt)
          W[it->first + jt->first] = min(it->second, jt->second) / 2;
        else
          W[it->first + jt->first] = min(it->second, jt->second);
      }
    }
  }
  for (auto it = W.begin(); it != W.end(); it++) {
    mx = max(mx, it->second);
  }
  cout << mx << "\n";
}
int main() {
  int step;
  cin >> step;
  ++step;
  while (--step) {
    solve();
  }
}
