#include <iostream>
using namespace std;
int main() {
int r;
cin >> r;
for(int i = 0; i < r; ++i){
int l, w, h;
cin >> l >> w >> h;
int s = 2 * h * (w + l);
cout << (s % 16 != 0 ? s / 16 + 1 : s / 16) << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewogICAgaW50IHI7CiAgICBjaW4gPj4gcjsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCByOyArK2kpewogICAgICAgIGludCBsLCB3LCBoOyAKICAgICAgICBjaW4gPj4gbCA+PiB3ID4+IGg7CiAgICAgICAgaW50IHMgPSAyICogaCAqICh3ICsgbCk7CiAgICAgICAgY291dCA8PCAocyAlIDE2ICE9IDAgPyBzIC8gMTYgKyAxIDogcyAvIDE2KSA8PCBlbmRsOwogICAgfQogICAgcmV0dXJuIDA7Cn0=