#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int A[3];
    for (long long int i = 0; i < 3; i++) cin >> A[i];
    sort(A, A + 3);
    cout << A[1] + (A[2] - (A[1] - A[0])) / 2 << endl;
  }
}
