#include <bits/stdc++.h>
using namespace std;
bool flag = 0, flag1 = 0, flag2 = 0;
long long int power(long long int a, long long int b) {
  long long int re = 1;
  while (b) {
    if (b & 1) re = (re * a);
    a = (a * a);
    b = b >> 1;
  }
  return re;
}
bool isPrime(long long int n) {
  if (n == 1 || n == 0) return false;
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int tn = 1;
  cin >> tn;
  while (tn--) {
    long long int n;
    cin >> n;
    long long int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    long long int ans = 0;
    for (long long int i = 2; i < (2 * n) + 1; i++) {
      long long int sum = 0;
      map<long long int, long long int> y;
      for (long long int j = 0; j < n; j++) y[a[j]]++;
      for (long long int j = 0; j < n; j++) {
        long long int rem = i - a[j];
        if (y[rem] != 0 && y[a[j]] != 0) {
          if (rem == a[j] && y[rem] == 1) continue;
          sum++;
          y[rem]--;
          y[a[j]]--;
        }
      }
      ans = max(ans, sum);
    }
    cout << ans << "\n";
  }
  return 0;
}
