#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int i, l, r, ct, ans = 0, a[n];
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    for (i = 1; i < 2 * n + 1; i++) {
      l = 0;
      r = n - 1;
      ct = 0;
      while (l < r) {
        if (a[l] + a[r] == i) {
          l++;
          r--;
          ct++;
          continue;
        }
        if (a[l] + a[r] < i) {
          l++;
        } else {
          r--;
        }
      }
      ans = max(ans, ct);
    }
    cout << ans << "\n";
  }
  return 0;
}
