#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n = 0;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  if (n < 2) {
    cout << 0 << endl;
    return;
  }
  sort(arr.begin(), arr.end());
  int max = 0;
  for (int weight = 1; weight <= 2 * n; weight++) {
    int left = 0;
    int right = n - 1;
    int pairs = 0;
    while (left < right) {
      if (arr[left] + arr[right] == weight) {
        pairs++;
        left++;
        right--;
      } else if (arr[left] + arr[right] < weight) {
        left++;
      } else {
        right--;
      }
    }
    if (pairs > max) {
      max = pairs;
    }
  }
  cout << max << endl;
  return;
}
int main() {
  int times = 0;
  scanf("%d", &times);
  for (int i = 0; i < times; i++) {
    solve();
  }
  return 0;
}
