#include <bits/stdc++.h>
using namespace std;
vector<bool> visited(51, false);
void init() {
  int i;
  for (i = 1; i <= 50; i++) visited[i] = false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n), freq(n + 1);
    int i;
    for (i = 0; i <= n - 1; i++) {
      cin >> a[i];
      freq[a[i]]++;
    }
    int maxp = 0, ctr = 0;
    int j;
    for (i = 1; i <= 2 * n; i++) {
      init();
      int temp = 0;
      int j;
      for (j = 0; j <= n - 1; j++) {
        int x = i - a[j];
        if (x > n || x <= 0 || visited[a[j]]) continue;
        if (x == a[j]) {
          temp += freq[a[j]] / 2;
          visited[a[j]] = true;
          continue;
        }
        temp += min(freq[a[j]], freq[x]);
        visited[a[j]] = true;
        visited[x] = true;
      }
      if (temp > maxp) {
        maxp = temp;
        ctr = i;
      }
    }
    cout << maxp << "\n";
  }
  return 0;
}
