#include <bits/stdc++.h>
#pragma GCC optimize "trapv"
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    long long int l = (n > 1 ? a[0] + a[1] : a[0]);
    long long int r = (n > 1 ? a[n - 1] + a[n - 2] : a[n - 1]);
    long long int ans = 0;
    long long int vis[n];
    memset(vis, 0, sizeof(vis));
    for (long long int wt = l; wt <= r; wt++) {
      long long int num = 0;
      for (long long int i = 0; i < n; i++) {
        for (long long int j = i + 1; j < n; j++) {
          if (!vis[i] && !vis[j] && a[i] + a[j] == wt) {
            num++;
            vis[i] = 1;
            vis[j] = 1;
          }
        }
      }
      for (long long int i = 0; i < n; i++) vis[i] = 0;
      ans = max(ans, num);
    }
    cout << ans << endl;
  }
  return 0;
}
