Monocarp has $$$a$$$ slices of cheese and $$$b$$$ slices of sausage. He wants to make the maximum possible number of sandwiches for his friends from them.
Monocarp is very thrifty, so he must use all $$$a$$$ slices of cheese and all $$$b$$$ slices of sausage without any leftovers to make the sandwiches. In addition, he has the following rules for making sandwiches:
Help Monocarp determine the maximum number of sandwiches he can make, or determine that it is impossible to distribute all slices according to these rules.
The first line contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
The only line of each test case contains two integers $$$a$$$ and $$$b$$$ ($$$1 \le a, b \le 100$$$) — the number of slices of cheese and sausage, respectively.
For each test case, print one integer — the maximum number of sandwiches that can be made. If it is impossible to distribute all pieces according to the described rules, print $$$-1$$$ instead.
36 45 14 5
21-1
In the first test case, it is possible to make $$$2$$$ sandwiches. For example, each of the two sandwiches can be made from three slices of cheese and two pieces of sausage.
In the second test case, it is possible to make $$$1$$$ sandwich from five slices of cheese and one slice of sausage.
In the third test case, it is impossible to make sandwiches while using all slices of cheese and sausage, so you have to print $$$-1$$$.