[Solution] Make Multiple CodeChef Solution
Problem
Chef has two integers and .
Chef can choose any non-negative integer and add them to both and . Find whether it is possible to make a divisor of .
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of two integers and .
Output Format
For each test case, output YES
if it is possible to make a factor of , NO
otherwise.
You can print each character of the string in uppercase or lowercase. For example, the strings Yes
, YES
, yes
, and yEs
, are all considered identical.
Explanation:
Test case : We can choose and add them to and . Thus, is a factor of .
👇👇👇👇👇
Test case : We can choose and add them to and . Thus, is a factor of .
Test case : There is no possible value of to add such that becomes a factor of .
No comments:
Post a Comment