Finally Avengers got all the infinity stones, after a lot of discussion it was decided to destroy all of them (all except the mind stone!). Only way to destroy mind stone is to fragment it in maximum number of pieces using certain ways. Mind stone contains a 'n' neurons. Also 3 numbers 'a', 'b' and 'c' can be infered from reading a mind stone. Mind stone is destroyed if n neurons are divided into MAXIMUM number of groups (number of neurons in each group be 'a', 'b', 'c'). Your task is to give Avengers the number of groups of neurons that should be formed. If it's not possible to divide mind stone, print "-1" (without quotes).
INPUT:
First line contains t, no. of test cases.
First line of each test case contains a single line containing space separated integers n, a, b, c
OUTPUT
For each test case print maximum number of groups that may be formed in a new line.
CONSTRAINTS:
1 <= t <= 10
1 <= n <= 10^5
1 <= a,b,c <= 100
In first test case you need to divide n such that each group has either 5, 3 or 1 neurons and the number of groups thus formed should be maximum.
Here, optimal way is to divide 8 neurons into 8 groups of 1 neuron.
In second it's not possible to split 10 into groups of 7.