#include <bits/stdc++.h>
int main(void) {
  long long n, i, j, a, s;
  scanf("%I64d", &n);
  for (i = 0; i < n; i++) {
    s = 0;
    for (j = 0; j < 3; j++) {
      scanf("%I64d", &a);
      s += a;
    }
    printf("%I64d\n", s / 2);
  }
}
