#include <bits/stdc++.h>
using namespace std;
const int N = 10 + 2e5;
const int mod = 1e9 + 7;
int main() {
  long long a, b, c;
  int t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    cout << (a + b + c) / 2 << endl;
  }
}
