#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int n,m;
cin>>n>>m;
string s;
cin>>s;
int count=0;
for(int j=0;j<n;j++)
{
if(s[j]==‘1’)
count++;
}
long long int ans=n*m;
if(count==0)
cout<<ans<<'\n';
else if(count%2!=0 && m%2!=0)
cout<<"0\n";
else
{
int temp1=0,temp2=0;
vector<int> v;
for(int j=0;j<n;j++)
{
if(s[j]=='1')
{
v.push_back(j);
}
}
for(int j=0;j<n;j++)
{
if(s[j]=='1')
{
temp1=j;
break;
}
}
for(int j=n-1;j>=0;j--)
{
if(s[j]=='1')
{
temp2=n-1-j;
break;
}
}
if(m%2==0)
{
cout<<temp2+temp1+1<<'\n';
}
else
{
cout<< v[count/2]-v[count/2 - 1] <<'\n';
}
}
}
return 0;
}
can anyone tell anyone test case where this code fails