#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (a && b) a > b ? a %= b : b %= a;
  return a + b;
}
const int N = 200001;
const double pi = acos(-1);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) cin >> arr[i];
    unordered_map<int, int> mp, temp;
    set<int> sums;
    for (int i = 0; i < n; i++) {
      mp[arr[i]]++;
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        sums.insert(arr[i] + arr[j]);
      }
    }
    int ans = 0;
    temp = mp;
    for (auto it : sums) {
      int count = 0;
      temp = mp;
      for (int i = 0; i < n; i++) {
        if (temp[arr[i]] > 0 && temp[it - arr[i]] > 0) {
          if (arr[i] == (it - arr[i])) {
            if (temp[arr[i]] >= 2) {
              count++;
              temp[arr[i]] -= 2;
            }
          } else {
            count++;
            temp[arr[i]]--;
            temp[it - arr[i]]--;
          }
        }
      }
      ans = max(ans, count);
    }
    cout << ans << "\n";
  }
}
