Where is my code incorrect

My issue

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	long long t;
	cin>>t;
	while(t--){
	    long long n;
	    cin>>n;
	    long long a[n];
	    for(long long i=0;i<n;i++){
	        cin>>a[i];
	    }
	    sort(a,a+n);
	    reverse(a,a+n);
	    int y = a[0];
	    long long h = floor(log2(y));
	   long long v = pow(2,h);
	    long long cnt =0;
	    for(long long i=1;i<n;i++){
	        if((a[i]&v)!=0){cnt++;}
	    }
	        cout<<(cnt/2)+1<<endl;
	 
	}
	return 0;
}

Problem Link: BOX95 Problem - CodeChef