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