[Solution] OR Tuples CodeChef Solution
Problem
Chef has numbers , and . Chef wants to find the number of triples such that:
- and (Here, denotes the bitwise OR operation)
Can you help Chef?
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of a single line of input containing space-separated integers denoting and
👇👇👇👇👇
- respectively.
Output Format
For each test case, output a single integer denoting the number of triplets that satisfy the given conditions.
Explanation:
Test case : The following triplets satisfy and : and .
Test case : The following triplet satisfies and : .
Test case : There are no triplets satisfying all the conditions.
No comments:
Post a Comment