#include <bits/stdc++.h>
using namespace std;
void fprime(int n, bool prime[]) {
  memset(prime, true, sizeof(prime));
  for (int i = 2; i * i <= n; i++) {
    if (prime[i] == true) {
      for (int j = i * i; j <= n; j += i) prime[j] = false;
    }
  }
}
long long power(long long x, unsigned int y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool myComparison(const pair<long long, long long> &a,
                  const pair<long long, long long> &b) {
  return a.second < b.second;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x, i, ans = 0;
    cin >> n;
    vector<int> cnt(n + 1);
    for (i = 0; i < n; i++) {
      cin >> x;
      cnt[x] += 1;
    }
    for (int j = 2; j <= 2 * n; j++) {
      int cur = 0;
      for (i = 1; i < (j + 1) / 2; i++) {
        if (j - i > n) continue;
        cur += min(cnt[i], cnt[j - i]);
      }
      if (j % 2 == 0) cur += cnt[j / 2] / 2;
      ans = max(ans, cur);
    }
    cout << ans << '\n';
  }
  return 0;
}
