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