#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
const long long inf = 1e18;
long long arr[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int test;
  cin >> test;
  while (test--) {
    cin >> arr[0] >> arr[1] >> arr[2];
    cout << (arr[0] + arr[1] + arr[2]) / 2 << endl;
  }
}
