#include <bits/stdc++.h>
using namespace std;
long long int xo(long long int x, long long int y) {
  return (x | y) & (~x | ~y);
}
void swapp(long long int* a, long long int* b) {
  long long int t = *a;
  *a = *b;
  *b = t;
}
long long int bin_Expo(long long int x, long long int n) {
  if (x == 0) return 0;
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return bin_Expo(x * x, n / 2);
  else
    return x * bin_Expo(x * x, (n - 1) / 2);
}
long long int mod_Expo(long long int x, long long int n, long long int M) {
  if (x == 0) return 0;
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return mod_Expo((x * x) % M, n / 2, M);
  else
    return (x * mod_Expo((x * x) % M, (n - 1) / 2, M)) % M;
}
bool prime_check(long long int x) {
  bool prime = (x >= 2);
  for (long long int i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      prime = false;
      break;
    }
  }
  return prime;
}
void sum_digit(long long int x, long long int b[]) {
  long long int d = 0, h = 0;
  while (x) {
    b[h] += x % 10;
    x /= 10;
    h++;
  }
  return;
}
bool cmp(pair<long long int, pair<long long int, long long int> >& a,
         pair<long long int, pair<long long int, long long int> >& b) {
  if (a.first > b.first)
    return true;
  else if (a.first == b.first) {
    return a.second.second < b.second.second;
  } else
    return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  cin >> TESTS;
  while (TESTS--) {
    long long int n, k, i, j, ans, ans1, x, pos, maxir, maxic, mini, l, h, mid,
        m, r, c, a, b;
    string t, s;
    ans = 0;
    ans1 = 0;
    long long int d[3];
    for (long long int i = 0; i < 3; i++) cin >> d[i];
    sort(d, d + 3);
    a = d[0];
    b = d[1];
    c = d[2];
    h = (c + b - a) / 2;
    cout << a + h << '\n';
  }
  return 0;
}
