#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long _;
  cin >> _;
  for (long long ts = 0; ts < _; ++ts) {
    int n;
    cin >> n;
    vector<int> data;
    for (int i = 0; i < n; ++i) {
      int tmp;
      cin >> tmp;
      data.push_back(tmp);
    }
    sort(data.begin(), data.end());
    int ans = 0;
    int left = 2, right = data.back() * 2;
    for (int i = left; i <= right; ++i) {
      int curAns = 0;
      int l = 0, r = data.size() - 1;
      while (l < r) {
        if (data[l] + data[r] == i) {
          curAns++;
          l++;
          r--;
        } else if (data[l] + data[r] > i) {
          r--;
        } else {
          l++;
        }
      }
      ans = max(ans, curAns);
    }
    cout << ans << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
