{"raw_statement":[{"iden":"problem statement","content":"We have $N_2$ sticks of length $2$ each, $N_3$ sticks of length $3$ each, and $N_4$ sticks of length $4$ each. You can do the following operation any number of times.\n\n*   Choose two sticks.\n*   Let $x$ and $y$ be the lengths of these sticks. Bond them to form a stick of length $x+y$.\n\nFind the maximum number of sticks that can be made whose lengths are exactly $10$.\nGiven $T$ test cases, solve each of them."},{"iden":"constraints","content":"*   $1\\leq T\\leq 100$\n*   $0\\leq N_2, N_3, N_4\\leq 10^{15}$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\text{case}_2$\n$\\vdots$\n$\\text{case}_T$\n\nEach case is in the following format:\n\n$N_2$ $N_3$ $N_4$"},{"iden":"sample input 1","content":"5\n3 4 1\n7 0 0\n0 0 7\n0 0 0\n1000000000000000 1000000000000000 1000000000000000"},{"iden":"sample output 1","content":"2\n1\n0\n0\n900000000000000\n\nLet us describe the first case. We have three sticks of length $2$, four sticks of length $3$, and one stick of length $4$.\nOne way to make two sticks of length exactly $10$ is as follows.\n\n*   Bond four sticks of length $2$, $2$, $3$, $3$ in some order to make one stick of length $10$.\n*   Bond three sticks of length $3$, $3$, $4$ in some order to make one stick of length $10$.\n*   Now we have three sticks of length $2$, $10$, $10$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}