The school canteen has four types of fruits: apricots, bananas, apples, and pears. There are three different possible sets of fruits available for lunch:
The canteen's employees want to assemble as many lunch fruit sets for children as possible. Help them do it!
Since the number of fruits delivered is different every day, you need to solve the problem for multiple test cases.
The first line of the input contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
The following $$$t$$$ lines contain a description of each test case. Each line contains four integers $$$a$$$, $$$b$$$, $$$c$$$, and $$$d$$$ ($$$1 \le a, b, c, d \le 10^9$$$) — the number of apricots, bananas, apples, and pears, respectively.
For each test case, print the maximum number of fruit sets it's possible to make.
| Subtask | Score | Constraints |
| $$$1$$$ | $$$10$$$ | $$$t \le 10$$$; $$$a, b, c, d \le 10$$$ |
| $$$2$$$ | $$$20$$$ | $$$t \le 10^4$$$; $$$a, b, c, d \le 10$$$ |
| $$$3$$$ | $$$20$$$ | $$$t \le 10$$$; $$$a, b, c, d \le 200$$$ |
| $$$4$$$ | $$$20$$$ | $$$t \le 10$$$; $$$a, b, c, d \le 10^6$$$ |
| $$$5$$$ | $$$30$$$ | No additional constraints |
63 3 3 33 1 4 14 3 2 13 3 6 59 7 6 79 10 10 6
2 2 2 3 5 6
In the first case, you can make two sets of fruits: one of type $$$1$$$ and one of type $$$3$$$.
In the second case, one of the possible answers is $$$(2, 3)$$$.
In the third case, the optimal answer is $$$(1, 1)$$$.
In the fourth case, you can make three sets of type $$$3$$$.
| Name |
|---|


