#include <bits/stdc++.h>
using namespace std;
const int maxx = 1e9;
int main() {
  int n;
  cin >> n;
  long long a, b, c;
  while (n--) {
    cin >> a >> b >> c;
    long long ans = a + b + c;
    if (ans & 1)
      cout << (ans - 1) / 2 << endl;
    else
      cout << ans / 2 << endl;
  }
  return 0;
}
