#include <bits/stdc++.h>
using namespace std;
void pre() {}
void solve() {
  int n;
  cin >> n;
  int m1[120] = {};
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m1[a[i]]++;
  }
  int ans = -1;
  for (int i = 1; i <= 100; i++) {
    int co = 0;
    int m2[120] = {};
    for (int j = 0; j < 120; j++) {
      m2[j] = m1[j];
    }
    for (int j = 1; j <= 50; j++) {
      int temp1 = m2[j];
      int temp2 = m2[i - j];
      int tak = min(temp1, temp2);
      if (j == (i - j)) {
        tak = tak / 2;
        m2[j] -= tak;
      } else {
        m2[j] -= tak;
        m2[i - j] -= tak;
      }
      co += tak;
    }
    ans = max(ans, co);
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  pre();
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) solve();
  return 0;
}
