Question: : Here,(&)represents bitwiseAND operator. You are required to find the number of different values of(x)for which(F(x))is maximized. There exists a condition for(x)that it must have

: Here,\(\&\)represents bitwiseAND operator.

You are required to find the number of different values of\(x\)for which\(F(x)\)is maximized. There exists a condition for\(x\)that it must have exactly\(l\)bits sets in its binary representation.

Your task is to find a number of such values for which this function is maximized. Print the required number.

If there are infinitesuch numbers, then print -1.

It can be proved that under the given constraints the value to be printed is either infinite or not greater than 1e18.

Input format

  • The first linecontains the number of test cases,\(T\).
  • The second line contains two space-separated integers\(n\)and\(l\)(as described in the problem).
  • The third line contains\(n\)space seprated integers\(A_1,A_2,A_3.....A_n\).

Output format

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!