#include <bits/stdc++.h>
using namespace std;
long long int hasArrayTwoCandidates(long long int A[], long long int arr_size,
                                    long long int sum) {
  long long int l, r;
  sort(A, A + arr_size);
  l = 0;
  r = arr_size - 1;
  long long int pairs = 0;
  while (l < r) {
    if (A[l] + A[r] == sum) {
      pairs++;
      l++;
      r--;
    } else if (A[l] + A[r] < sum)
      l++;
    else
      r--;
  }
  return pairs;
}
int main() {
  long long int t;
  cin >> t;
  while (t-- > 0) {
    long long int n;
    cin >> n;
    long long int w[n];
    for (long long int i = 0; i < n; i++) {
      cin >> w[i];
    }
    long long int maxv = 0;
    sort(w, w + n);
    for (long long int i = 2; i <= 2 * n; i++) {
      long long int num = hasArrayTwoCandidates(w, n, i);
      maxv = max(maxv, num);
    }
    cout << maxv << endl;
  }
  return 0;
}
