#include <bits/stdc++.h>
using namespace std;
bool compareInterval(pair<int, int> &p1, pair<int, int> &p2) {
  return (p1.second < p2.second);
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, c;
    cin >> a >> b >> c;
    cout << (a + b + c) / 2 << "\n";
  }
}
