Help me in solving BOX95 problem

My issue

why some test cases are giving wrong answer please help

My code

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

int main() {
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        int a[n];
        int arr2[64] = {0};
        for(int i=0;i<n;i++)
    {
    	cin>>a[i];
    	int msb=0;

    	for(int j=63;j>=0;j--)
    	{
    	    int val=(int)pow(2,j);
    	    if( (val & a[i] ) != 0 )
    	    {msb=j; break;}
    	}
    	arr2[msb]++;

    }
    
    for(int i=63;i>=0;i--)
    {
        if(arr2[i]!=0)
        {
            cout<<(arr2[i]+1)/2<<"\n";
            break;
        }
    }
}
    return 0;
}

Problem Link: Boxes Practice Coding Problem - CodeChef

int does not accomodate powers of 2 greater than 30 (as it is a 32-bit data type). Try using larger data-types. Also, pow function has inaccuracies when computing and recasting back to integer. It is better to use bitwise operators or plain multiply to get the required power.

I have tried modifying your code and it submits correctly.
https://www.codechef.com/viewsolution/1049641096