#include <bits/stdc++.h>
using namespace std;
long long int mod_Expo(long long int x, long long int n, long long int M) {
  if (x == 0) return 0;
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return mod_Expo((x * x) % M, n / 2, M);
  else
    return (x * mod_Expo((x * x) % M, (n - 1) / 2, M)) % M;
}
long long int binaryExponentiation(long long int x, long long int n) {
  if (x == 0) return 0;
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return binaryExponentiation(x * x, n / 2);
  else
    return x * binaryExponentiation(x * x, (n - 1) / 2);
}
long long int GCD(long long int A, long long int B) {
  if (B == 0)
    return A;
  else
    return GCD(B, A % B);
}
bool prime_check(long long int x) {
  bool prime = (x >= 2);
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      prime = false;
      break;
    }
  }
  return prime;
}
long long int min1(long long int a, long long int b, long long int c) {
  vector<long long int> v1, v2, v3;
  v1.push_back(b);
  v1.push_back(c);
  v1.push_back(a);
  sort(v1.begin(), v1.end());
  return v1[0];
}
long long int min(long long int a, long long int b) {
  if (a <= b)
    return a;
  else
    return b;
}
long long int bin_search(long long int x, long long int low, long long int high,
                         vector<long long int> v1) {
  while (high > low) {
    long long int mid = low + (high - low) / 2;
    if (v1[mid] > x)
      high = mid;
    else
      low = mid + 1;
  }
  return high;
}
long long int digitsum(long long int n) {
  long long int sum = 0;
  while (n != 0) {
    sum = sum + n % 10;
    n = n / 10;
  }
  return sum;
}
long long int fact(long long int n) {
  long long int arr[n + 2], i;
  arr[0] = 1;
  arr[1] = 1;
  for (i = 2; i <= n + 2; i++) {
    arr[i] = i * arr[i - 1];
  }
  if (n == 0)
    return 1;
  else
    return arr[n];
}
bool vis[100005] = {false};
int temp;
vector<vector<long long int> > v;
vector<long long int> arr;
void dfs(long long int s) {
  long long int min1;
  vis[s] = true;
  long long int k = 1;
  temp = min(arr[s - 1], temp);
  for (long long int i = 0; i < v[s].size(); i++) {
    if (vis[v[s][i]] == false) {
      dfs(v[s][i]);
    }
  }
}
long long int val[100005] = {0};
void bfs(long long int s) {
  queue<long long int> q;
  q.push(s);
  vis[s] = true;
  val[s] = 1;
  while (!q.empty()) {
    long long int x = q.front();
    q.pop();
    for (long long int i = 0; i < v[x].size(); i++) {
      if (vis[v[x][i]] == false) {
        q.push(v[x][i]);
        vis[v[x][i]] = true;
        val[v[x][i]] = 1 + val[x];
      }
    }
  }
}
int multiply(int x, int res[], int res_size);
void factorial(int n) {
  int res[500];
  res[0] = 1;
  int res_size = 1;
  for (int x = 2; x <= n; x++) res_size = multiply(x, res, res_size);
  cout << "Factorial of given number is \n";
  for (int i = res_size - 1; i >= 0; i--) cout << res[i];
}
int multiply(int x, int res[], int res_size) {
  int carry = 0;
  for (int i = 0; i < res_size; i++) {
    int prod = res[i] * x + carry;
    res[i] = prod % 10;
    carry = prod / 10;
  }
  while (carry) {
    res[res_size] = carry % 10;
    carry = carry / 10;
    res_size++;
  }
  return res_size;
}
long long int binomialCoeff(long long int n, long long int k) {
  long long int res = 1;
  if (k > n - k) k = n - k;
  for (long long int i = 0; i < k; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, i, j, t, f, g = 0, m, x, y, z, k, a = 0, b = 0, c = 0, q, x1,
                               x2, y1, y2, x3, min1 = 1000000, x4, sum, d,
                               M = 998244353, r, p, sum1 = 0, sum2 = 0,
                               sum3 = 0, sum4, sum5, max1 = 0, sum6;
  cin >> t;
  while (t--) {
    cin >> n;
    long long int arr[n], arr1[51] = {0};
    vector<long long int> v;
    max1 = 0;
    for (i = 0; i < n; i++) {
      cin >> arr[i];
      arr1[arr[i]]++;
    }
    for (i = 1; i <= 50; i++) {
      if (arr1[i] > 0) v.push_back(i);
    }
    x = v.size();
    if (x <= 1)
      cout << arr1[v[0]] / 2 << endl;
    else {
      for (i = 2; i <= 100; i++) {
        sum = 0;
        for (j = 0; j < x; j++) {
          for (k = j; k < x; k++) {
            if (v[k] + v[j] == i) {
              if (v[k] == v[j])
                sum += arr1[v[j]] / 2;
              else
                sum += min(arr1[v[k]], arr1[v[j]]);
            }
          }
        }
        max1 = max(sum, max1);
      }
      cout << max1 << endl;
    }
  }
}
