#include <bits/stdc++.h>
int main() {
  int i, t;
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    long long int a, b, c, k;
    scanf("%lld %lld %lld", &a, &b, &c);
    k = ((a + b + c) / 2);
    printf("%lld\n", k);
  }
  return 0;
}
