#include <bits/stdc++.h>
using namespace std;
long long int arr[1000006] = {0};
long long int n = 0;
long long int tp(0), tp1(0), tp2(0), tp3(0), tp4(0);
string str;
long long int len;
void pre_processing() {}
void solve() {
  cin >> n;
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  set<long long int> st;
  for (long long int i = 0; i < n; i++)
    for (long long int j = i + 1; j < n; j++) st.insert(arr[i] + arr[j]);
  long long int ans = 0;
  sort(arr, arr + n);
  for (auto sum : st) {
    long long int tans = 0;
    long long int l = 0, h = n - 1;
    while (l < h) {
      if (arr[l] + arr[h] == sum)
        l++, h--, tans++;
      else if (arr[l] + arr[h] > sum)
        h--;
      else
        l++;
    }
    ans = max(ans, tans);
  }
  cout << ans << '\n';
  ;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  pre_processing();
  long long int tc = 1;
  if (true) cin >> tc;
  for (long long int t = 1; t <= tc; t++) {
    solve();
  }
  return 0;
}
