#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    unsigned long long a, b, c;
    scanf("%llu %llu %llu", &a, &b, &c);
    printf("%llu\n", (a + b + c) / 2);
  }
}
