
The first line of input contains an integer ‘T’ denoting the number of test cases.
The first and only line of the test case consists of three integers ‘A’, ‘B’, and ‘C’.
For each test case, print a single line containing a single integer denoting the minimum number of flips required.
The output of each test case will be printed in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 11
1 <= A <= 10 ^ 9
1 <= B <= 10 ^ 9
1 <= C <= 10 ^ 9
Where 'T' is the number of test cases and 'A', 'B', 'C' are given integers.
Time Limit: 1 sec.
Run a loop from 0 to 32 since there are 32 bits in int . If the ith bit of C is 1 then at least ith bit of A or B should be 1. If none of the ith bit of A and B is 1 then set the bit of either A or B to 1.Thus one flip operation is required. If the ith bit of C is 0 then the ith bit of both A and B should be 0.
Algorithm: