**any idea what’s wrong with this code.I am debugging this from 3 days and not able to find any problem.compiler is also not giving any warnings**

```
#include"bits/stdc++.h"
using namespace std;
bool getBit(long long int x,long long int pos)
{
return (( x & (1 << pos)) != 0);
}
int main(void) {
// your code goes here
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int t;
cin>>t;
while(t--)
{
long long int n,k;
cin>>n>>k;
vector<long long int> bits(32,0);
vector<long long int> arr(n);
long long int count=0;
for(long long int i=0;i<n;i++)
{
cin>>arr[i];
if(arr[i]!=0)
{
for(int j=31;j>=0;j++)
{
//storing how many set bits are present at a particular position j
if(getBit(arr[i],j))
bits[j]++;
}
count++;
}
}
if(count==0)
{
cout<<0<<"\n";
continue;
}
long long int ans=0;
for(int i=0;i<32;i++)
{
if(bits[i]<=k&&bits[i]!=0)
ans++;
else{
ans=ans+(bits[i]/k);
ans++;
}
}
cout<<ans<<endl;
}
return 0;
}
```