BETA

Difficulty Level: Easy

Submissions: 415 Accuracy:

26.27%

Power Of 2 and Subsequences
       

Given is an array of size N, find all the subsequence which when multiplied results in a number which is Power of 2.

Input:

First line contains an integer T denoting number of Test Cases. First line of each test case contains N, the next line contains n integers of the array.

Output:

Print the total number of such subsequence exits. As this number can be very large print the result under modulo 10^9+7.

 

Constraints:
1<= T <=100
1<= N <=10^5
1<= A[i] <= 10^9

Example:
Input
1
3
1 6 2

Output
3

Explanation:

The subsequence that can be chosen is {1} , {2} and {1,2}.

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: ShivamKD

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.