#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    int n;
    cin >> n;
    vector<int> weights(51, 0);
    int temp;
    for (int i = 0; i < n; i++) {
      cin >> temp;
      weights[temp]++;
    }
    int maxPossible = 0;
    for (int i = 2; i <= 100; i++) {
      int result = 0;
      int low, high;
      low = 1;
      high = i - 1;
      while (low <= high) {
        if (low == high) {
          result += weights[low] / 2;
        } else if (high <= 50) {
          result += min(weights[low], weights[high]);
        }
        low++;
        high--;
      }
      maxPossible = max(result, maxPossible);
    }
    cout << maxPossible << endl;
  }
  return 0;
}
