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).

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'def r():\n return list(map(int,input().split()))\ndef process(stack):\n if len(stack)<k+1:\n  ans.extend(stack)\n  return\n # print stack,\n # nonlocal count\n if len(stack)%(k+1)==0:\n  # print "as"\n  for i in range(k,len(stack)-1,k+1):\n   stack[i]=(stack[i]+1)%2\n  stack[-2]=(stack[-2]+1)%2\n else:\n  for i in range(k,len(stack),k+1):\n   # print i\n   stack[i]=(stack[i]+1)%2\n # count+=((len(stack)+k)/(k+1))\n # print stack\n ans.extend(stack)\nfor i in range(eval(input())):\n n,k = r()\n arr = list(map(int,list(input())))\n if k==1:\n  s=[]\n  c=0\n  for i in range(n):\n   s.append((c+1)%2)\n   c+=1\n  s1=[]\n  c=1\n  for i in range(n):\n   s1.append((c+1)%2)\n   c+=1\n  ans1,ans2=0,0\n  for i in range(n):\n   if arr[i]!=s1[i]:\n    ans2+=1\n   if arr[i]!=s[i]:\n    ans1+=1\n  s1=list(map(str,s1))\n  s=list(map(str,s))\n  if ans1<ans2:\n   print(ans1)\n   print(\'\'.join(s))\n  else:\n   print(ans2)\n   print(\'\'.join(s1))\n else:\n  # print japasas\n  ans=[]\n  c=1\n  count=0\n  stack=[arr[0]]\n  for i in range(1,n):\n   if arr[i]==arr[i-1]:\n    stack.append(arr[i])\n   else:\n    process(stack)\n    stack=[arr[i]]\n  # ans.extend(stack)\n  process(stack)\n  count=0\n  for i in range(n):\n   if ans[i]!=arr[i]:\n    count+=1\n  print(count)\n  ans=list(map(str,ans))\n  print(\'\'.join(ans))'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 17922