#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, k = 0, t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    k = a + b + c;
    cout << k / 2 << endl;
    k = 0;
  }
}
