You are given an array A of size N. Your task is to find the number of subarrays within the given array such that:
Note: The subarray of A is a contiguous part of the array A, i. e. the array Ai,Ai+1,....,Aj for some 1≤i≤j≤N.
Input format
Output format
For each test case, print the number of subarrays within the given array such that the Bitwise AND of all elements in the subarray has an odd number of set bits (i.e., 1s) and Bitwise XOR of all elements in the subarray has an even number of set bits (i.e., 1s) in a new line.
Constraints
1≤T≤1051≤N≤1061≤A[i]≤109 ∀ i∈[1,N]The sum of all values of N over all test cases doesn't exceed 106
For test case 1:
In the given array there are the following 5 subarrays with their AND having an even number of set bits and their XOR having an odd number of set bits:
Thus, the answer is 5.