AtCoder Regular Contest 126
A
Make 10
AtCoder
⌀ 465
原题
←B →
翻译中…

Problem Statement

翻译中…

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.

翻译中…
  • Choose two sticks.
  • Let $x$ and $y$ be the lengths of these sticks. Bond them to form a stick of length $x+y$.
翻译中…

Find the maximum number of sticks that can be made whose lengths are exactly $10$.

翻译中…

Given $T$ test cases, solve each of them.

翻译中…

Constraints

翻译中…
  • $1\leq T\leq 100$
  • $0\leq N_2, N_3, N_4\leq 10^{15}$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

T
\text{case}_1
\text{case}_2
\vdots
\text{case}_T

翻译中…

Each case is in the following format:

翻译中…

N_2 N_3 N_4

翻译中…

Output

翻译中…

Print $T$ lines; the $i$-th line should contain the answer for $\text{case}_i$.

翻译中…

样例

Input #1
5
3 4 1
7 0 0
0 0 7
0 0 0
1000000000000000 1000000000000000 1000000000000000
Output #1
2
1
0
0
900000000000000
Let us describe the first case. We have three sticks of length $2$, four sticks of length $3$, and one stick of length $4$. One way to make two sticks of length exactly $10$ is as follows. - Bond four sticks of length $2$, $2$, $3$, $3$ in some order to make one stick of length $10$. - Bond three sticks of length $3$, $3$, $4$ in some order to make one stick of length $10$. - Now we have three sticks of length $2$, $10$, $10$.
题目信息
题号
arc126_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。