#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 1;
int a[101], b[101];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    set<int> q;
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      a[x]++;
      q.insert(x);
    }
    vector<int> pot;
    for (auto t = q.begin(); t != q.end(); t++) pot.push_back(*t);
    int maxx = 0;
    for (int i = 0; i < pot.size(); i++) {
      b[pot[i] * 2] += a[pot[i]] / 2;
      for (int j = i + 1; j < pot.size(); j++) {
        b[pot[i] + pot[j]] += min(a[pot[i]], a[pot[j]]);
      }
    }
    for (int i = 1; i <= n * 2; i++) maxx = max(maxx, b[i]);
    cout << maxx << endl;
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
  }
}
