#include <bits/stdc++.h>
using namespace std;
const int N = 256, INF = 1e9;
int T, n;
int w[N], cnt[N];
int main() {
  int i, j;
  int x;
  scanf("%d", &T);
  int res, ans;
  while (T--) {
    ans = -INF;
    scanf("%d", &n);
    for (i = 1; i <= n; i++) scanf("%d", &w[i]);
    for (i = 2; i <= (n << 1); i++) {
      memset(cnt, 0, sizeof cnt);
      res = 0;
      for (j = 1; j <= n; j++) cnt[w[j]]++;
      for (j = 1; i - j >= 1; j++) {
        if (cnt[j] == 0) continue;
        if (i - j == j) {
          res += cnt[j] / 2;
          cnt[j] = cnt[j] % 2;
        } else {
          x = min(cnt[j], cnt[i - j]);
          res += x;
          cnt[j] -= x;
          cnt[i - j] -= x;
        }
      }
      ans = max(ans, res);
    }
    printf("%d\n", ans);
  }
  return 0;
}
