import java.io.BufferedReader;
import java.io.InputStreamReader;
class Main
{
{
String[] params1
= bufferedReader.
readLine().
split(" "); int r;
for(int i = 0; i < r; ++i){
String[] params2
= bufferedReader.
readLine().
split(" "); int l, w, h;
int s = 2 * h * (w + l);
System.
out.
print(s
% 16 != 0 ? s
/ 16 + 1 : s
/ 16); }
}
}
aW1wb3J0IGphdmEuaW8uQnVmZmVyZWRSZWFkZXI7CmltcG9ydCBqYXZhLmlvLklucHV0U3RyZWFtUmVhZGVyOwoKY2xhc3MgTWFpbgp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlCdWZmZXJlZFJlYWRlciBidWZmZXJlZFJlYWRlciA9IG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtLmluKSk7CgkJU3RyaW5nW10gcGFyYW1zMSA9IGJ1ZmZlcmVkUmVhZGVyLnJlYWRMaW5lKCkuc3BsaXQoIiAiKTsKCQlpbnQgcjsKCQlyID0gSW50ZWdlci5wYXJzZUludChwYXJhbXMxWzBdKTsKCQlmb3IoaW50IGkgPSAwOyBpIDwgcjsgKytpKXsKCQkJU3RyaW5nW10gcGFyYW1zMiA9IGJ1ZmZlcmVkUmVhZGVyLnJlYWRMaW5lKCkuc3BsaXQoIiAiKTsKCQkJaW50IGwsIHcsIGg7IAoJCQlsID0gSW50ZWdlci5wYXJzZUludChwYXJhbXMyWzBdKTsKCQkJdyA9IEludGVnZXIucGFyc2VJbnQocGFyYW1zMlsxXSk7CgkJCWggPSBJbnRlZ2VyLnBhcnNlSW50KHBhcmFtczJbMl0pOwoJCQlpbnQgcyA9IDIgKiBoICogKHcgKyBsKTsKCQkJU3lzdGVtLm91dC5wcmludChzICUgMTYgIT0gMCA/IHMgLyAxNiArIDEgOiBzIC8gMTYpOwoJCQlTeXN0ZW0ub3V0LnByaW50KCJcbiIpOwoJCX0KCX0KfQ==