GUPTA MECHANICAL

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

Wednesday 6 July 2022

[Solution] Prime Xor CodeChef Solution | Codechef Solution


For 3 distinct prime integers A,B, and C (1<A,B,C<230), we define positive integers X,Y, and Z as:
X=AB,Y=BC, and Z=CA, where  denotes the bitwise XOR operation.

Given only two integers X and Y and the fact that at least one integer amongst X,Y, and Z is odd, find the values of A,B, and C.

Note:

Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇
  • You need to print the integers A,B, and C in ascending order.
  • It is guaranteed in the input that a unique answer exists.

Input Format

  • The first line contains one integer T — the number of test cases. Then T test cases follow.
  • Each test case consists of one line which contains 2 integers X and Y.

Output Format

  • For each test case, print 3 integers — A,B, and C in ascending order where (1<A,B,C<230).

Constraints

  • 1T105

No comments:

Post a Comment