#include <bits/stdc++.h>
using namespace std;
void call() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void solve() {
  long long n;
  cin >> n;
  long long a[n], b[n];
  for (long long i = 0; i < n; i++) cin >> a[i], b[i] = a[i];
  if (n == 1) {
    cout << "0\n";
    return;
  }
  sort(a, a + n);
  long long k = a[0] + a[1];
  long long m = a[n - 1] + a[n - 2];
  long long maxi = INT_MIN;
  for (long long mm = k; mm <= m; mm++) {
    long long sum = 0;
    for (long long i = 0; i < n; i++) {
      if (a[i] != -1) {
        for (long long j = 0; j < n; j++) {
          if (a[j] != -1) {
            if (a[i] + a[j] == mm and (i != j)) {
              a[i] = -1;
              a[j] = -1;
              sum++;
              break;
            }
          }
        }
      }
    }
    maxi = max(maxi, sum);
    for (long long l = 0; l < n; l++) a[l] = b[l];
  }
  cout << maxi << "\n";
}
int32_t main() {
  call();
  long long t;
  cin >> t;
  while (t--) solve();
}
