#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long i, k;
    long long a[n];
    map<long long, long long> mp;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      mp[a[i]]++;
    }
    long long ans = INT_MIN;
    long long maxteam = 0;
    for (i = 1; i <= 100; i++) {
      long long curans = 0;
      for (k = 1; k <= i / 2; k++) {
        if (i - k == k) {
          curans = curans + mp[k] / 2;
        } else
          curans = curans + min(mp[k], mp[i - k]);
      }
      if (curans > ans) {
        ans = curans;
        maxteam = i;
      }
    }
    cout << ans << "\n";
  }
}
