#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tests;
  cin >> tests;
  while (tests--) {
    int n;
    cin >> n;
    int a[n];
    int ma = 0;
    int mp[100] = {0};
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      mp[a[i]]++;
    }
    for (int i = 2; i <= n + n; i++) {
      int p = 0;
      for (int j = 1; j <= i / 2; j++) {
        if (i - j != j)
          p += min(mp[j], mp[i - j]);
        else
          p += (mp[j] / 2);
      }
      ma = max(ma, p);
    }
    cout << ma << endl;
  }
  return 0;
}
