#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> A(n);
    int cnt[55] = {0};
    for (auto& i : A) {
      cin >> i;
      cnt[i]++;
    }
    int answ = INT_MIN;
    for (int s = 2; s <= 2 * n; s++) {
      int ans = 0;
      for (int i = 1; i < (s + 1) / 2; i++) {
        if (s - i > n) continue;
        ans += min(cnt[i], cnt[s - i]);
      }
      if (s % 2 == 0) ans += cnt[s / 2] / 2;
      answ = max(answ, ans);
    }
    cout << answ << '\n';
  }
  return 0;
}
