[Solution] Equivalent Numbers CodeChef Solution
Problem
Chef calls a pair of integers equivalent if there exist some positive integers and such that .
Given and , determine whether the pair is equivalent or not.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of two space-separated integers and , as mentioned in statement.
Output Format
For each test case, output YES
if is an equivalent pair, NO
otherwise.
The output is case-insensitive. Thus, the strings Yes
, YES
, yes
, and yeS
are all considered identical.
Explanation:
Test case : There are no positive integers and which satisfy .
Test case : Let and . Thus, and . Thus, the pair is equivalent.
Test case : There are no positive integers and which satisfy .
No comments:
Post a Comment