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