#include <bits/stdc++.h>
int main() {
  int q;
  unsigned long long a, b, c;
  scanf("%d", &q);
  while (q--) {
    scanf("%llu%llu%llu", &a, &b, &c);
    printf("%llu\n", (a + b + c) >> 1);
  }
  return 0;
}
