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