#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, ans = INT_MIN;
  cin >> n;
  int ar[n];
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  sort(ar, ar + n);
  for (int i = 2; i <= 2 * n; i++) {
    int tot = 0, l = 0, h = n - 1;
    while (l < h) {
      if (ar[l] + ar[h] == i) {
        tot++;
        h--;
        l++;
      } else if (ar[l] + ar[h] > i) {
        h--;
      } else {
        l++;
      }
    }
    ans = max(ans, tot);
  }
  cout << ans << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
