#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int ar[n], i, j, sum = 0;
    set<int> s;
    for (i = 0; i < n; i++) {
      cin >> ar[i];
    }
    sort(ar, ar + n);
    for (i = 0; i < n; i++) {
      for (j = i + 1; j < n; j++) {
        sum = ar[i] + ar[j];
        s.insert(sum);
      }
    }
    vector<int> v;
    for (auto it = s.begin(); it != s.end(); it++) {
      v.push_back(*it);
    }
    int b[n], max1 = 0, k, z, c;
    for (k = 0; k < v.size(); k++) {
      c = 0;
      i = 0;
      j = n - 1;
      while (i < j) {
        if (ar[i] + ar[j] == v[k]) {
          c++;
          i++;
          j--;
        } else if (ar[i] + ar[j] > v[k]) {
          j--;
        } else {
          i++;
        }
      }
      if (c > max1) {
        max1 = c;
      }
    }
    cout << max1 << endl;
  }
}
