#include <bits/stdc++.h>
using namespace std;
inline int readInt() {
  int n = 0, ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) n = n * 10 + ch - '0', ch = getchar();
  return n;
}
const int MAX_N = 250 + 3, MAX_P = 2000 + 3;
int n, a[MAX_N], cnt[MAX_P];
inline double E(int a[]) { return accumulate(a, a + 250, 0.0) / 250; }
inline double D(int a[]) {
  double avg = E(a), s = 0;
  for (int i = 0; i < 250; ++i) s += (a[i] - avg) * (a[i] - avg);
  s /= 250;
  return s;
}
int main() {
  int caseNum = readInt();
  while (caseNum--) {
    n = 250;
    for (int i = 0; i < 250; ++i) a[i] = readInt();
    double e = E(a), d = D(a), val = (e - d) / e;
    if (fabs(val) < 0.5) {
      printf("%d\n", int(round(e)));
    } else {
      printf("%d\n", *max_element(a, a + n) / 2);
    }
  }
  return 0;
}
