#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> w(n);
    for (int i = 0; i < n; i++) cin >> w[i];
    if (n == 1) {
      cout << 0 << "\n";
      continue;
    }
    int res = 0;
    for (int i = 2; i <= 2 * n; i++) {
      vector<int> count(2 * n + 1, 0);
      int pairs = 0;
      for (int j = 0; j < n; j++) {
        if (w[j] < i && count[i - w[j]] != 0) {
          count[i - w[j]]--;
          pairs++;
        } else
          count[w[j]]++;
      }
      res = max(res, pairs);
    }
    cout << res << "\n";
  }
  return 0;
}
