#include <bits/stdc++.h>
using namespace std;
void solution() {
  int queries;
  int64_t candy, answer;
  cin >> queries;
  while (queries--) {
    answer = 0;
    for (int i = 0; i < 3; i++) {
      cin >> candy;
      answer += candy;
    }
    cout << answer / 2 << "\n";
  }
}
int main() {
  solution();
  return 0;
}
