#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
vector<pair<long long, long long> > g[200001];
map<pair<long long, long long>, long long> used;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    long long a, b, c;
    cin >> a >> b >> c;
    cout << (a + b + c) / 2ll << '\n';
  }
  return 0;
}
