#include <bits/stdc++.h>
using namespace std;
void quickstart() { ios_base::sync_with_stdio(0); }
int main() {
  quickstart();
  long long t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int *w = new int[n];
    for (int i = 0; i < n; i++) {
      cin >> w[i];
    }
    sort(w, w + n);
    int sum_max = w[n - 1] + w[n - 2];
    int sum_min = w[0] + w[1];
    int ans = 0;
    int temp_ans;
    for (int sum = sum_min; sum <= sum_max; sum += 1) {
      int i = 0;
      temp_ans = 0;
      int j = n - 1;
      while (i < j) {
        if (w[i] + w[j] < sum) {
          i += 1;
        } else if (w[i] + w[j] > sum) {
          j -= 1;
        } else {
          temp_ans += 1;
          i += 1;
          j -= 1;
        }
      }
      ans = max(ans, temp_ans);
    }
    cout << ans << endl;
  }
  return 0;
}
