#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int out = 0;
  for (int s = 2; s <= 2 * n; s++) {
    int ans = 0, l = 0, r = n - 1;
    while (l < r) {
      if (v[l] + v[r] == s) {
        ans++;
        l++;
        r--;
      } else if (v[l] + v[r] > s)
        r--;
      else
        l++;
    }
    out = max(out, ans);
  }
  cout << out << endl;
  return;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
