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