#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v;
  long long w;
};
long long MOD = 1000000007;
long long _MOD = 1000000009;
double EPS = 1e-10;
const int N = 250;
double F[10001];
double uniform(int N, vector<int> a, int p) {
  double sum = 0;
  for (int i = 0; i < N; i++) {
    if (0 <= a[i] && a[i] <= p * 2)
      sum += log(1.0 / (p * 2 + 1));
    else
      return -DBL_MAX;
  }
  return sum;
}
double poisson(int N, vector<int> a, int p) {
  double sum = 0;
  for (int i = 0; i < N; i++) {
    sum += log(p) * a[i];
    sum += -p;
    sum -= F[a[i]];
  }
  return sum;
}
int main() {
  for (int x = 1; x <= 10000; x++) F[x] = F[x - 1] + log(x);
  int T;
  cin >> T;
  while (T--) {
    vector<int> a(N);
    for (int i = 0; i < N; i++) scanf("%d", &a[i]);
    double ma = -DBL_MAX;
    int p0;
    for (int p = 10; p <= 1000; p++) {
      double q = max(uniform(N, a, p), poisson(N, a, p));
      if (q > ma) ma = q, p0 = p;
    }
    cout << p0 << endl;
  }
}
