#include <bits/stdc++.h>
using namespace std;
int main() {
  ifstream myfile;
  ofstream yourfile;
  myfile.open("input.txt");
  yourfile.open("output.txt");
  int q;
  long long int a, b, c, maxx;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> a >> b >> c;
    maxx = a + b + c;
    maxx = maxx / 2;
    cout << maxx << "\n";
  }
  myfile.close();
  yourfile.close();
  return 0;
}
