A Bit Easy CodeChef Solution | CodeChef Problem Solution 2022
Chef was impressed by an array of non-negative integers. But, he was asked to solve the following problem in order to get this array.
Given a non-negative integer , find the number of pairs such that the following condition holds true:
, where
- denotes Bitwise OR operation,
- denotes Bitwise XOR operation,
- denotes Bitwise AND operation.
Solution Click Below:- CLICK HERE
You, being Chef's friend, help him get this array by solving the above problem.
Input Format
- The first line contains an integer , the number of test cases.
- The first line of each test case contains two space-separated integers and , the number of integers in the array and the non-negative integer respectively.
- The next line contains space-separated non-negative integers , the elements of the array .
Output Format
For each test case, print a single line containing the number of pairs satisfying the mentioned condition.
Constraints
- Sum of over all test cases does not exceed .
Join Now for Solution:-
No comments:
Post a Comment