#include <bits/stdc++.h>
using namespace std;
string digit = "0123456789";
string small = "abcdefghijklmnopqrstuvwxyz";
string capital = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, 1, -1, 0, 0, -1, 1};
int dx4[] = {1, -1, 0, 0};
int dy4[] = {0, 0, 1, -1};
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    set<int> s;
    map<int, int> mp;
    for (int i = (int)(0); i < (int)(n); i++) {
      int a;
      cin >> a;
      s.insert(a);
      mp[a]++;
    }
    int ans = 0;
    for (int i = 1 + 1; i <= 100; i++) {
      int cnt = 0;
      for (auto iterator = s.begin(); iterator != s.end(); iterator++) {
        int t = (*iterator);
        int tt = i - t;
        cnt += min(mp[t], mp[tt]);
      }
      ans = max(ans, cnt);
    }
    cout << ans / 2 << "\n";
  }
}
