TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

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?

Input Format

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.

Output Format

For each test case, output Yes if it is possible to have non-negative integers a and b. Otherwise output No.

Sample Input 1

3
6 5
2 1
4 4

Sample Output 1

Yes
No
Yes

Hints

Problem Source

Migrated from old NTUJ.

Tmt, Ferng

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 200