#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using namespace std;
int main() {
  int q;
  long long int a, b, c;
  long long int ans = 0;
  cin >> q;
  while (q--) {
    cin >> a >> b >> c;
    ans = (a + b + c) / 2;
    cout << ans << "\n";
  }
  return 0;
}
