#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, in, n, root, num;
  scanf("%lld", &n);
  while (n--) {
    scanf("%lld", &i);
    scanf("%lld", &j);
    scanf("%lld", &k);
    in = i + j + k;
    in /= 2;
    printf("%lld", in);
    printf("\n");
  }
  return 0;
}
