#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q, a, b, c;
  cin >> q;
  while (q--) {
    cin >> a >> b >> c;
    long long ans = a + b + c;
    if (ans % 2 != 0) {
      ans--;
    }
    ans = ans / 2;
    cout << ans << endl;
  }
  return 0;
}
