#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int w[n];
    int s, smin, smax;
    int kmax = 0, k;
    for (int i = 0; i < n; i++) {
      cin >> w[i];
    }
    sort(w, w + n);
    if (n == 1) {
      cout << 0 << endl;
      continue;
    }
    smin = w[0] + w[1];
    smax = w[n - 1] + w[n - 2];
    for (s = smin; s <= smax; s++) {
      k = 0;
      int head = 0, tail = n - 1;
      while (head < tail) {
        if (w[head] + w[tail] == s) {
          k++;
          head++;
          tail--;
        } else if (w[head] + w[tail] > s) {
          tail--;
        } else {
          head++;
        }
      }
      if (k > kmax) {
        kmax = k;
      }
    }
    cout << kmax << endl;
  }
}
