GUPTA MECHANICAL

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

Wednesday 8 June 2022

[Solution] Equal Distribution Codechef Solution

Alice and Bob are very good friends and they always distribute all the eatables equally among themselves.

Alice has A chocolates and Bob has B chocolates. Determine whether Alice and Bob can distribute all the chocolates equally among themselves.

Note that:

  • It is not allowed to break a chocolate into more than one piece.
  • No chocolate shall be left in the distribution.
Solution Click Below:-  CLICK HERE


Input Format

  • The first line of input will contain an integer T — the number of test cases. The description of T test cases follows.
  • The first and only line of each test case contains two space-separated integers 

  • A and B, the number of chocolates that Alice and Bob have, respectively.

Output Format

For each test case, output on a new line YES if Alice and Bob can distribute all the chocolates equally, else output NO. The output is case insensitive, i.e, yesYeSyES will all be accepted as correct answers when Alice and Bob can distribute the chocolates equally.

Constraints

  • 1T1000

No comments:

Post a Comment