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