#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int test_cases;
scanf("%d" , &test_cases);
while(test_cases--){
int length;
int flips;
scanf("%d %d" , &length , &flips);
int string[length];
int occurence[length+1];
memset(occurence,0,sizeof(occurence));
int i = 0;
int way1 = 0;
int way0= 0;
int count1 = 1;
int count0 = 0;
int temp;
int count = 1;
int thatmax = 0;
while(i<length){
scanf("%1d" , &string[i]);