#include <bits/stdc++.h>
using namespace std;
int t;
long long int a, b, c;
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lld%lld%lld", &a, &b, &c);
    printf("%lld\n", (a + b + c) / 2);
  }
  return 0;
}
