#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int garb;
  if (n == 1) {
    cin >> garb;
    cout << 0 << "\n";
    return;
  }
  vector<int> a(n);
  for (int &e : a) {
    cin >> e;
  }
  sort(a.begin(), a.end());
  int largest = a[n - 1] + a[n - 2];
  int best = 0;
  for (int sum = 2; sum <= largest; sum++) {
    int pairs = 0;
    int L = 0, R = n - 1;
    while (L < R) {
      if (a[L] + a[R] == sum) {
        pairs++;
        L++;
        R--;
      } else if (a[L] + a[R] < sum) {
        L++;
      } else {
        R--;
      }
    }
    best = max(best, pairs);
  }
  cout << best << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
