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