#include <bits/stdc++.h>
int main() {
  int t;
  std::cin >> t;
  while (t--) {
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (int i = 0; i < n; i++) std::cin >> a[i];
    std::vector<int> valueCount(2 * n + 1);
    std::vector<int> sum;
    for (int i = 0; i < n; i++) valueCount[a[i]]++;
    for (int i = 0; i < n; i++)
      for (int j = i + 1; j < n; j++) sum.push_back(a[i] + a[j]);
    std::sort(sum.begin(), sum.end());
    auto ret = std::unique(sum.begin(), sum.end());
    sum.resize(std::distance(sum.begin(), ret));
    int ans = 0;
    for (const auto s : sum) {
      int team = 0;
      for (int i = 1; i <= s / 2; i++) {
        if (i == s - i)
          team += valueCount[i] / 2;
        else
          team += std::min(valueCount[i], valueCount[s - i]);
      }
      ans = std::max(ans, team);
    }
    std::cout << ans << std::endl;
  }
  return 0;
}
