#include <bits/stdc++.h>
using namespace std;
int64_t R = 1;
int64_t count_i(int64_t k, map<int64_t, int64_t> mp, vector<int64_t> a) {
  int64_t cnt = 0;
  map<int64_t, int64_t> used;
  for (int i = 0; i < (a).size(); i++) {
    if (mp[a[i]]) {
      int64_t it = k - a[i];
      if (mp[it] > 0) {
        if (it == a[i] && mp[it] < 2) continue;
        cnt++;
        mp[it]--;
        mp[a[i]]--;
      }
    }
  }
  return cnt;
}
void solution() {
  int64_t n, mx1 = 0, ans = 0, mn = INT_MAX;
  cin >> n;
  vector<int64_t> a(n);
  map<int64_t, int64_t> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
    mn = min(mn, a[i]);
    mx1 = max(mx1, a[i]);
  }
  for (int i = mn; i <= mx1 * 2; i++) {
    ans = max(ans, count_i(i, mp, a));
  }
  cout << ans << "\n";
}
int main() {
  cin >> R;
  for (long long int i = 0; i < R; i++) {
    solution();
  }
  return 0;
}
