#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return a > b; }
int main() {
  cin.tie(0);
  cout.tie(0);
  iostream::sync_with_stdio(0);
  long long testcases;
  cin >> testcases;
  for (long long x = 0; x < testcases; x++) {
    long long a, b, c;
    cin >> a >> b >> c;
    cout << (a + b + c) / 2 << '\n';
  }
  return 0;
}
