#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v1;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v1.push_back(a);
  }
  sort(v1.begin(), v1.end());
  set<int> sati;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      sati.insert(v1[i] + v1[j]);
    }
  }
  set<int>::iterator it = sati.begin();
  int cnt = 0;
  while (it != sati.end()) {
    int sub_cnt = 0;
    int first = 0;
    int last = n - 1;
    while (first < last) {
      if (v1[first] + v1[last] == *it) {
        first++;
        last--;
        sub_cnt++;
      } else if (v1[first] + v1[last] > *it)
        last--;
      else
        first++;
    }
    if (cnt < sub_cnt) cnt = sub_cnt;
    it++;
  }
  cout << cnt << endl;
  v1.clear();
}
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
