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