#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  long long q, a, b, c;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> a >> b >> c;
    cout << (a + b + c) / 2 << endl;
  }
  return 0;
}
