#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long T;
  cin >> T;
  long long a, b, c;
  while (T--) cin >> a >> b >> c, cout << (a + b + c) / 2 << '\n';
  return 0;
}
