#include<bits/stdc++.h>
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define prime_number[21]={11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97}
///POLICY BASED DATA STRUCTURE..
///order_of_key return number of element which are strictly greater/smaller than x..
///find_by_order return ans iterator corresponding to the xth position of the set..
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define faster_bro ios_base::sync_with_stdio(false);cin.tie(NULL)
#define esp 0.0000000001
#define ss second
#define ff first
#define nl cout<<endl
//memset(ar,-1,sizeof(ar));
// (1LL<<i) more than efficient pow(2,i);
void fast(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int main(){
fast();
int tc;
cin>>tc;
int h=1;
while(tc--){
ll a,b,c,sum=0,sum1=0,sum2=0,cnt=0,mx=LLONG_MIN,mn=LLONG_MAX,mx1=-1e18,mx2=-1e18;
cin>>a;
vector<ll>vc[32];
ll ar[a+1];
for(int i=1;i<=a;i++){
cin>>ar[i];
mx=max(ar[i],mx);
}
int bit;
for(int i=31;i>=0;i--){
int msk=(1LL) & (mx>>i);
if(msk==1){
bit=i;
break;
}
}
for(int i=0;i<=bit;i++){
int sum=0;
vc[i].push_back(0);
for(int j=1;j<=a;j++){
int msk=(1LL) & (ar[j]>>i);
if(msk==1){
sum++;
}
vc[i].push_back(sum);
}
}
for(int i=1;i<a;i++){
bool f;
for(int j=0;j<=bit;j++){
int l=vc[j][i-1];
int sz=vc[j].size();
int l1=vc[j][sz-1]-vc[j][i-1];
if((l%2==0 && l1%2==0)||(l%2!=0 && l1%2!=0)){
f=true;
}
else{
f=false;
break;
}
}
if(f){
cnt++;
}
}
cout<<cnt<<endl;
}
}