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