#1295. Problem B. 连接召唤
Problem B. 连接召唤
You are now in a magical land, and you have five different types of sprites around you. The ability value of the -th sprite is .
At this moment, a sprite summoner with a sprite of ability value passes by. This sprite with an ability value of looks very powerful, so you quickly ask him how to obtain this kind of sprite and obtain a method called "Link Summon" from him.
Link Summon: Each time, choose some sprites with ability values from to . For each sprite, you can choose to assign a weight of or a weight of ( is its ability value), and then obtain \textbf{one} sprite with the sum of the weights of these sprites. However, due to magical restrictions, the sum of the weights cannot exceed .
Now you want to know how many sprites with an ability value of you can summon by linking the sprites in your possession.
Input
The first line contains an integer (), indicating the number of data sets.
Next are lines, each containing five integers (), indicating the number of sprites you currently have with an ability value of .
Output
For each set of data, output a single integer on a line, indicating the maximum number of sprites with an ability value of that you can summon through linking.
Example
5
3 3 3 3 3
2 3 4 5 1
1 2 3 4 5
2 2 0 0 0
0 3 0 0 3
7
7
7
1
3