GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Wednesday, 26 October 2022

[Solution] Make Multiple CodeChef Solution




Problem

Chef has two integers A and B (A \leq B).

Chef can choose any non-negative integer X and add them to both A and B. Find whether it is possible to make A a divisor of B.

Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.
  • Each test case consists of two integers A and B.

Output Format

For each test case, output YES if it is possible to make A a factor of B, 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 1: We can choose X = 0 and add them to 3 and 6. Thus, 3 is a factor of 6.


Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

Test case 2: We can choose X = 1 and add them to 4 and 14. Thus, 4+1 = 5 is a factor of 14+1 = 15.

Test case 3: There is no possible value of X to add such that A becomes a factor of B.

No comments:

Post a Comment