#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v(n);
    unordered_map<long long, long long> m;
    long long mas = INT_MIN;
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      mas = max(v[i], mas);
      m[v[i]]++;
    }
    sort(v.begin(), v.end());
    long long s;
    long long ans = 0;
    for (s = 2; s <= 2 * mas; s++) {
      map<long long, long long> m1;
      for (auto i : m) {
        m1[i.first] = i.second;
      }
      long long ctr = 0;
      for (long long i = 0; i < n; i++) {
        if (m1[v[i]] != 0) {
          if (m1[s - v[i]] > 0 && v[i] != s - v[i] && s != v[i]) {
            ctr++;
            m1[v[i]]--;
            m1[s - v[i]]--;
          } else if (v[i] == s - v[i] && m1[v[i]] > 1 && s != v[i]) {
            ctr++;
            m1[v[i]] -= 2;
          }
        }
      }
      ans = max(ans, ctr);
    }
    cout << ans << "\n";
  }
  return 0;
}
