BETA

Difficulty Level: Basic

Submissions: 331 Accuracy:

38.37%

Count Pairs Odd Xor
       

Given an array Arr[] of N integers. Write a program to find out number of pairs in array whose XOR is odd.

Input:
First line of input contains a single integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains a single integer N which denotes the size of array. Second line of each test case contains N space separated integers which denotes the elements of the array.

Output:
For each test case print the number of pairs in array whose XOR is odd.

Constraints:
1<=T<=100
1<=N<=1000
1<=Arr[i]<=1000

Example:
Input:

2
3
1 2 3
4
1 2 3 4
Output:
2
4

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

Contributor: Harsh Agarwal

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.