Devu loves to play with binary strings a lot. One day he borrowed a binary string s of size n from his friend Churu. Before starting to play with it, he wants to make sure that string does not contain more than  k consecutive equal characters. For achieving that, only kind of operation he is allowed to perform is to flip any ith character of the string. 
As Devu is always in hurry to meet his girlfriend, he wants you to help him in finding out the minimum number of operations he will need. Also he wants you to print one of the possible modified string too.
-----Input-----
- First line of input contains an integer T denoting the number of test cases. 
- For each test case, there are two lines. 
- First line contains two space separated integers n, k as defined in the problem. 
- Next line contains string s of size n.
-----Output-----
- For each test case, print two lines.
- First line should contain an integer corresponding to minimum number of operations Devu needs.
- In second line, print one of the possible modified strings.
-----Constraints-----
Subtask #1: 20 points
- 1 ≤ T ≤ 100, 1 ≤ n ≤ 20, 1 ≤ k ≤ n
Subtask #2: 35 points
- 1 ≤ T ≤ 102, 1 ≤ n ≤ 103, 1 ≤ k ≤ n
Subtask #3: 45 points
- 1 ≤ T ≤ 105, 1 ≤ n ≤ 105, 1 ≤ k ≤ n
- Sum of n over all the test cases is ≤ 106 
-----Example-----
Input:
3
2 1
11
2 2
11
4 1
1001
Output:
1
10
0
11
2
1010
-----Explanation-----
Example case 1: As 1 is occurring twice consecutively, we can convert 11 to 10 in a single operation.
Example case 2: You don't need to modify the string as it does not have more than 2 equal consecutive character.
Example case 3: As 0 is occurring twice consecutively, we can convert 1001 to 1010 in a two operations (Flip third and fourth character).
T= int(input());

for i in range(T):
 n,k = list(map(int,input().split()));
 s=list(map(int,input()));

 if k==1:
  s_0 ={};
  s_1={};
  c0=0;
  c1=0;
  for j in range(n):
   if(j%2==0):
    s_1[j]=1;
    s_0[j]=0;
   else:
    s_1[j]=0;
    s_0[j]=1;
  for j in range(n):
   if(s_0[j]-s[j]!=0):
    c0+=1;
   if(s_1[j]-s[j]!=0):
    c1+=1;

  if c0<c1:
   print(c0);
   p_s="";
   for j in range(n):
    p_s+=str(s_0[j]);
   print(p_s);
  else:
   print(c1);
   p_s="";
   for j in range(n):
    p_s+=str(s_1[j]);
   print(p_s);

 else:
  count=1;
  c=s[0];
  flips=0
  for j in range(1,n):
   if(s[j]==c):
    count+=1;
    #print count;
    if count > k:
     if(j+1<n and s[j]==s[j+1]):
      if(s[j]==1):
       s[j]=0;
      else:
       s[j]=1;
     else:
      if(s[j-1]==1):
       s[j-1]=0;
      else:
       s[j-1]=1;
     flips+=1;
     count=1;


   elif(s[j]!=c):
    count=1;
   c=s[j];

  print(flips);
  p_s="";
  for j in range(n):
   p_s+=str(s[j]);
  print(p_s);
T= int(input());

for i in range(T):
 n,k = list(map(int,input().split()));
 s=list(map(int,input()));

 if k==1:
  s_0 ={};
  s_1={};
  c0=0;
  c1=0;
  for j in range(n):
   if(j%2==0):
    s_1[j]=1;
    s_0[j]=0;
   else:
    s_1[j]=0;
    s_0[j]=1;
  for j in range(n):
   if(s_0[j]-s[j]!=0):
    c0+=1;
   if(s_1[j]-s[j]!=0):
    c1+=1;

  if c0<c1:
   print(c0);
   p_s="";
   for j in range(n):
    p_s+=str(s_0[j]);
   print(p_s);
  else:
   print(c1);
   p_s="";
   for j in range(n):
    p_s+=str(s_1[j]);
   print(p_s);

 else:
  count=1;
  c=s[0];
  flips=0
  for j in range(1,n):
   if(s[j]==c):
    count+=1;
    #print count;
    if count > k:
     if(j+1<n and s[j]==s[j+1]):
      if(s[j]==1):
       s[j]=0;
      else:
       s[j]=1;
     else:
      if(s[j-1]==1):
       s[j-1]=0;
      else:
       s[j-1]=1;
     flips+=1;
     count=1;


   elif(s[j]!=c):
    count=1;
   c=s[j];

  print(flips);
  p_s="";
  for j in range(n):
   p_s+=str(s[j]);
  print(p_s);