A simple, homemade pizza -- all you need is a grams of mushroom and b grams of bacon. But, before you start making the pizza, you realized that your scale can only weigh over integral grams. The ultimate delicious way to make this pizza requires integer values X and Y, which is exactly a*b and a+b respectively. Now, you wonder whether you can make this remarkable pizza at home. That is, given integers X and Y, you need to make sure both a and b are non-negative integers. Is this possible?
The first line of the input file contains an integer T (1<= T<= 100) indicating the number of test cases.
For each test case, there are two integers X, Y (0<= |X|, |Y|<= 1000000000) separated by a space.
For each test case, output Yes if it is possible to have non-negative integers a and b. Otherwise output No.
3 6 5 2 1 4 4
Yes No Yes
Migrated from old NTUJ.
Tmt, Ferng
No. | Testdata Range | Score |
---|