#include <bits/stdc++.h>
using namespace std;
int getTeams(vector<int> &A, int val) {
  int st = 0, end = A.size() - 1, res = 0;
  while (st < end) {
    if (A[st] + A[end] > val)
      end--;
    else if (A[st] + A[end] < val)
      st++;
    else {
      res++;
      st++;
      end--;
    }
  }
  return res;
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    int n, mxTeams = INT_MIN;
    cin >> n;
    vector<int> A(n);
    for (int i = 0; i < n; i++) cin >> A[i];
    sort(A.begin(), A.end());
    if (n == 1)
      cout << 0 << '\n';
    else {
      int minw = A[0] + A[1];
      int maxw = A[n - 1] + A[n - 2];
      for (int i = minw; i <= maxw; i++) {
        mxTeams = max(mxTeams, getTeams(A, i));
      }
      cout << mxTeams << '\n';
    }
  }
  return 0;
}
