#include <bits/stdc++.h>
using namespace std;
int nQuerry;
int main() {
  cin >> nQuerry;
  while (nQuerry--) {
    long long foo, bar, magic;
    cin >> foo >> bar >> magic;
    cout << (foo + bar + magic) / 2 << endl;
  }
  return 0;
}
