#include <bits/stdc++.h>
using namespace std;
template <typename T>
T min(T a, T b) {
  return a < b ? a : b;
}
int main() {
  int q;
  cin >> q;
  while (q--) {
    vector<long long> a(3);
    cin >> a[0] >> a[1] >> a[2];
    long long sum = a[0] + a[1] + a[2];
    cout << sum / 2 << endl;
  }
}
