#include <bits/stdc++.h>
using namespace std;
double getAverage(const vector<int>& v) {
  int s = 0;
  for (int i = 0; i < (int)(v.size()); i++) s += v[i];
  double avg = s / (double)(v.size());
  return avg;
}
double getVariance(const vector<int>& v) {
  double mean = getAverage(v);
  double temp = 0;
  for (double a : v) temp += (a - mean) * (a - mean);
  return temp / v.size();
}
const int INF = 0x7FFFFFFF;
void solve(int test) {
  vector<int> v(250);
  for (int i = 0; i < (int)(250); i++) scanf("%d ", &v[i]);
  int mn = INF, mx = 0;
  for (int i = 0; i < (int)(250); i++) {
    mn = min(mn, v[i]);
    mx = max(mx, v[i]);
  }
  double k = getVariance(v) / getAverage(v);
  string distribution = (k > 2.0 ? "uniform" : "poisson");
  double avg = distribution == "poisson" ? getAverage(v) : (mx + mn) / 2.0;
  int estimate = (avg + 0.5);
  cout << estimate << endl;
}
int main() {
  int n;
  scanf("%d ", &n);
  for (int i = 0; i < (int)(n); i++) solve(i);
  return 0;
}
