#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int a[3];
    for (int i = 0; i < 3; i++) cin >> a[i];
    long long int sum = 0;
    for (int i = 0; i < 3; i++) sum = sum + a[i];
    if (sum % 2 == 0)
      cout << sum / 2 << endl;
    else {
      sum = sum - 1;
      cout << sum / 2 << endl;
    }
  }
  return 0;
}
