#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, c;
    cin >> a >> b >> c;
    cout << setprecision(20);
    bool even = false;
    if ((a + b + c) % 2 == 0) even = true;
    long long int out = (a + b + c) / 2;
    if (even)
      cout << out << endl;
    else
      cout << (a + b + c - 1) / 2 << endl;
  }
}
