#include <bits/stdc++.h>
using namespace std;
int a[255];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    double sum = 0;
    int m = 0;
    for (int j = 0; j < 250; j++) {
      scanf("%d", &a[j]);
      sum += a[j];
      m = max(m, a[j]);
    }
    sum /= 250.0;
    int ans = 0;
    for (int j = 0; j < 250; j++) {
      double x = (double)a[j] / sum;
      if (x >= 0.5 && x <= 1.5) ans++;
    }
    if (ans >= 175) {
      printf("%.0f\n", sum);
    } else {
      printf("%d\n", m / 2);
    }
  }
  return 0;
}
