#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, d;
  int q;
  cin >> q;
  while (q--) {
    cin >> a >> b >> c;
    d = (a + b + c) / 2;
    cout << d << "\n ";
  }
  return 0;
}
