GUPTA MECHANICAL

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

Sunday, 14 August 2022

[Solution] Make A and B equal CodeChef Solution


Problem

Chef has two numbers A and B.

In one operation, Chef can choose either A or B and multiply it by 2.

Determine whether he can make both A and B equal after any number (possibly, zero) of moves.

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 space-separated integers A and B.

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

Output Format

For each test case, output YES if Chef can make both numbers equal, NO otherwise.

Note that the checker is case-insensitive i.e. YESYesyesyES are all considered same.

Explanation:

Test case 1: Chef can multiply A by 2 twice and both A and B will become 20.

Test case 2: Both numbers are already equal.

Test case 3: It can be shown that A and B cannot be made equal.

Test case 4: It can be shown that A and B cannot be made equal.

No comments:

Post a Comment