#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, ans = 0, num[101], temp, minn = 1e9 + 7, maxx = 0, ann;
    for (int i = 1; i <= 100; i++) num[i] = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &temp);
      num[temp]++;
      minn = min(minn, temp);
      maxx = max(maxx, temp);
    }
    for (int i = 2; i <= maxx * 2; i++) {
      int sum = 0;
      for (int j = 1; j <= i / 2; j++)
        if (j != i - j)
          sum += min(num[j], num[i - j]);
        else
          sum += num[j] / 2;
      if (sum > ans) {
        ans = sum;
      }
    }
    printf("%d\n", ans);
  }
}
