#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> wt(n);
    for (long long i = 0; i < n; i++) {
      cin >> wt[i];
    }
    long long ans = 0;
    sort(wt.begin(), wt.end());
    for (long long i = 0; i < n - 1; i++) {
      for (long long j = i + 1; j < n; j++) {
        long long s = wt[i] + wt[j];
        long long i1 = 0, j1 = n - 1;
        long long cnt = 1;
        while (i1 < j1) {
          if (i1 == i || i1 == j) {
            i1++;
            continue;
          }
          if (j1 == i || j1 == j) {
            j1--;
            continue;
          }
          if (wt[i1] + wt[j1] == s) {
            cnt++;
            i1++;
            j1--;
          } else if (wt[i1] + wt[j1] > s) {
            j1--;
          } else {
            i1++;
          }
        }
        ans = max(ans, cnt);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
