#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <class T, class S>
ostream &operator<<(ostream &o, const pair<T, S> &p) {
  return o << '(' << p.first << ", " << p.second << ')';
}
template <template <class, class...> class T, class... A>
typename enable_if<!is_same<T<A...>, string>(), ostream &>::type operator<<(
    ostream &o, T<A...> V) {
  o << '[';
  for (auto a : V) o << a << ", ";
  return o << ']';
}
long long int ct[1000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int tc;
  cin >> tc;
  while (tc--) {
    fill_n(ct, 500, 0);
    long long int n;
    cin >> n;
    for (long long int i = 0; i < n; i++) {
      long long int x;
      cin >> x;
      ct[x]++;
    }
    long long int ans = 0;
    for (long long int w = 0; w < 200; w++) {
      long long int temp = 0;
      for (long long int i = 0; i < w; i++)
        if (i < w - i)
          temp += min(ct[i], ct[w - i]);
        else if (i == w - i)
          temp += ct[i] / 2;
      ans = max(ans, temp);
    }
    cout << ans << '\n';
  }
}
