//I have submitted this code when i run this in cmd it //runs perfectly by when i run it in the online compiler it //says couldnot find or load main class . Please help me //in this.
import java.util.Scanner;
class Martin
{
static int cnt=0;
public static void main(String args[])
{
int counter=0;
int T=0;
Scanner obj=new Scanner(System.in);
T=obj.nextInt();
for(int i=0;i<T;i++)
{ int N=0;
N=obj.nextInt();
int arr[]=new int[N];
for(int j=0;j<N;j++)
arr[j]=obj.nextInt();
for(int k=0;k<N;k++)
{
for(int l=0;k<N;k++)
{
// if(l<k)
// continue;
int m=calc(arr[k],arr[l]);
if(m%2==0)
cnt++;
else
counter++;
}
}
System.out.println(counter);
}
}
public static int calc(int x,int y)
{
return (x | y) &
(~x | ~y);
}
}