GUPTA MECHANICAL

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

Wednesday 29 June 2022

[Solution] Xor and Multiply CodeChef Solution | CodeChef Problem Solution 2022


JJ has three integers NA and B where 0A,B<2N. He wants to find a third integer X such that:

  • 0X<2N
  • the value of (AX)×(BX) is maximum.

Here  represents the Bitwise XOR operator.

Can you help him find such an integer X? If there are multiple integers which satisfy the given

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

 conditions, print any.

Input Format

  • The first line will contain T - number of test cases. Then the test cases follow.
  • The first and only line of each test case contains three integers NA and B - the integers

  •  mentioned in the problem statement.

Output Format

For each test case, output an integer X which satisfies the given conditions.

If multiple answers exist, print any.

Constraints

  • 1T5000
  • 1N30

No comments:

Post a Comment