#include <bits/stdc++.h>
using namespace std;
int t;
long long a[3], ans;
void relax(long long a, long long b) { ans = max(ans, (a + b) / 2); }
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lld%lld%lld", &a[0], &a[1], &a[2]);
    sort(a, a + 3);
    a[0] += a[2] - (a[2] / 2);
    a[1] += a[2] / 2;
    ans = 0;
    relax(a[0], a[1]);
    printf("%lld\n", ans);
  }
  return 0;
}
