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