#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 251;
const int P = 1005;
const double e = 2.718281828459045235360287471352;
int a[N];
double tp1[P << 1], tp2[P << 1];
int main() {
  int T = read();
  while (T--) {
    int mx = 0;
    double mean = 0;
    for (int i = 1; i <= 250; i++)
      a[i] = read(), mean += a[i], mx = max(mx, a[i]);
    double D = 0;
    mean /= 250;
    for (int i = 1; i <= 250; i++) D += a[i] * a[i];
    D /= (double)250;
    D -= mean * mean;
    double D1 = mean;
    double D2 = mean * mean / 3.0;
    if (fabs(D - D1) < fabs(D - D2))
      printf("%d\n", (int)mean);
    else
      printf("%d\n", (int)(mx + 1) / 2);
  }
  return 0;
}
