#include <bits/stdc++.h>
using namespace std;
long long a[1005], b[1005], c[1005], d, i, n;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i];
  for (i = 0; i < n; i++) {
    d = (a[i] + b[i] + c[i]) / 2;
    cout << d << endl;
  }
}
