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