#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int w[n];
  for (register int i = 0; i < n; i++) cin >> w[i];
  map<int, int> m;
  for (register int i = 0; i < n; i++) {
    m[w[i]]++;
  }
  int ans = 0;
  for (int i = 2; i <= 2 * n; i++) {
    int res = 0;
    vector<int> vis(n + 1);
    for (int j = 0; j < n; j++) {
      if (w[j] < i && vis[w[j]] == 0 && (i - w[j]) <= n) {
        if (i - w[j] != w[j])
          res += min(m[w[j]], m[i - w[j]]);
        else
          res += (m[w[j]]) / 2;
        vis[i - w[j]] = 1;
        vis[w[j]] = 1;
      }
    }
    ans = max(res, ans);
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  ;
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
