#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int q, a, b, c;
  cin >> q;
  long long int p[q];
  for (int i = 0; i < q; i++) {
    cin >> a >> b >> c;
    p[i] = (a + b + c) / 2;
  }
  for (int i = 0; i < q; i++) {
    cout << p[i] << '\n';
  }
}
