#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5, inf = 1e18;
long long q, a, b, c;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> q;
  for (long long i = 1; i <= q; i++) {
    cin >> a >> b >> c;
    cout << (a + b + c) / 2 << endl;
  }
  return 0;
}
