#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    map<int, int> make_pair;
    for (int i = 1; i <= 2 * n; i++) {
      make_pair[i] = 0;
    }
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      make_pair[a[i]]++;
    }
    int ans = 0;
    for (int i = 2; i <= 2 * n; i++) {
      int cur = 0;
      for (int j = 1; j < i; j++) {
        cur += min(make_pair[j], make_pair[i - j]);
      }
      cur /= 2;
      ans = max(ans, cur);
    }
    cout << ans << endl;
  }
  return 0;
}
