#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int64_t res = 0, a, b, c;
  cin >> t;
  while (t) {
    res = 0;
    cin >> a >> b >> c;
    res = (a + b + c) / 2;
    cout << res << endl;
    t--;
  }
}
