#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return (b ? __gcd(a, b) : a);
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
template <typename T>
T setbit(T x) {
  return __builtin_popcount(x);
}
const int MOD = 1e9 + 7;
const int INF = 1e9;
const int MAX = 1e6 + 10;
const int N = 1e5 + 5;
bool comp(int x, int y) { return x > y; }
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    if (n < 3) {
      cout << n - 1 << "\n";
      continue;
    }
    sort(a, a + n);
    int l = 0, r = n - 1, ans = 0;
    for (int s = a[0] + a[1]; s <= a[n - 2] + a[n - 1]; s++) {
      int l = 0, r = n - 1, team = 0;
      while (l < r) {
        if (a[l] + a[r] > s) {
          r--;
        } else if (a[l] + a[r] < s) {
          l++;
        } else {
          team++;
          l++;
          r--;
        }
      }
      ans = max(ans, team);
    }
    cout << ans << "\n";
  }
  return 0;
}
