#include <bits/stdc++.h>
using namespace std;
long long dr[] = {-1, 1, 0, 0, -1, 1, -1, 1};
long long dc[] = {0, 0, -1, 1, -1, -1, 1, 1};
int main() {
  long long T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    long long a[n];
    vector<long long> mark(n + 1);
    for (long long i = 0; i <= n; i++) {
      mark[i] = 0;
    }
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      mark[a[i]]++;
    }
    long long mx = n + n + 3;
    long long ans = 0;
    while (mx) {
      long long cnt = 0;
      vector<long long> bmark(n + 1);
      for (long long i = 1; i <= n; i++) {
        bmark[i] = mark[i];
      }
      for (long long i = 0; i < n; i++) {
        if (bmark[a[i]]) {
          bmark[a[i]]--;
          if (mx > a[i] and mx - a[i] <= n and bmark[mx - a[i]]) {
            bmark[mx - a[i]]--;
            cnt++;
          }
        }
      }
      ans = max(cnt, ans);
      mx--;
    }
    cout << ans << endl;
  }
  return 0;
}
