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