#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> vec;
    for (int i = 0; i < n; i++) {
      int p;
      cin >> p;
      vec.push_back(p);
    }
    sort(vec.begin(), vec.end());
    map<int, int> m;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        m[vec[i] + vec[j]] = 0;
      }
    }
    map<int, int>::iterator it;
    int mx = INT_MIN;
    for (it = m.begin(); it != m.end(); it++) {
      int p = it->first;
      int c = 0;
      int i = 0;
      int j = n - 1;
      while (i < j) {
        if ((vec[i] + vec[j]) == p) {
          c++;
          i++;
          j--;
        } else if ((vec[i] + vec[j]) < p) {
          i++;
        } else
          j--;
      }
      if (c > mx) mx = c;
    }
    if (mx < 0)
      cout << 0 << endl;
    else
      cout << mx << endl;
  }
  return 0;
}
