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