GUPTA MECHANICAL

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

Wednesday 22 June 2022

[Solution] Triple Xor CodeChef Solution | CodeChef Problem Solution 2022


You are given two integers N and K. Find number of ordered triplets (A,B,C) that satisfy the following conditions:

  • 0A,B,C<2N
  • A,B and C are distinct
  • ABC=K

Here,  denotes the bitwise XOR operation.

Input Format

  • The first line contains a single integer T — the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains two space-separated integers N and K — the
Solution Click Below:-  CLICK HERE


  •  parameters mentioned in the statement.

Output Format

For each test case, output on a new line the number of triplets that satisfy the given conditions.

Constraints

  • 1T5000
  • 2N20

No comments:

Post a Comment