#include <bits/stdc++.h>
using namespace std;
void init_code() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
}
void solve() {
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long int sum_freq[2 * n + 2];
  memset(sum_freq, 0, sizeof(sum_freq));
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      sum_freq[arr[i] + arr[j]]++;
    }
  }
  vector<long long int> poss;
  for (long long int i = 2; i <= 2 * n; i++) {
    if (sum_freq[i] > 0) {
      poss.push_back(i);
    }
  }
  long long int f_ans = 0;
  for (long long int i = 0; i < poss.size(); i++) {
    long long int sum = poss[i];
    long long int ans = 0;
    long long int vis[n];
    memset(vis, 0, sizeof(vis));
    for (long long int i = 0; i < n; i++) {
      if (vis[i] == 1) {
        continue;
      }
      for (long long int j = i + 1; j < n; j++) {
        if (vis[j] == 0 && arr[i] + arr[j] == sum) {
          ans++;
          vis[i] = 1;
          vis[j] = 1;
          break;
        }
      }
    }
    f_ans = max(ans, f_ans);
  }
  cout << f_ans << '\n';
}
int32_t main() {
  init_code();
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
