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