#!/bin/python3
import sys

t = int(input().strip())
for a0 in range(t):
    n,k = input().strip().split(' ')
    n,k = [int(n),int(k)]
    num = input().strip()   #this is a string
    result = []
    for i in range(n-k):
        multiply = 1
        for j in num[i:i+k]:
            multiply *= int(j)
        result.append(multiply)
    print(max(result))

fc0e771415e26248385a133e1aa495f8e9d65c14
<mask token>

<mask token>
for a0 in range(t):
    n, k = input().strip().split(' ')
    n, k = [int(n), int(k)]
    num = input().strip()
    result = []
    for i in range(n - k):
        multiply = 1
        for j in num[i:i + k]:
            multiply *= int(j)
        result.append(multiply)
    print(max(result))

<mask token>
t = int(input().strip())
for a0 in range(t):
    n, k = input().strip().split(' ')
    n, k = [int(n), int(k)]
    num = input().strip()
    result = []
    for i in range(n - k):
        multiply = 1
        for j in num[i:i + k]:
            multiply *= int(j)
        result.append(multiply)
    print(max(result))

import sys
t = int(input().strip())
for a0 in range(t):
    n, k = input().strip().split(' ')
    n, k = [int(n), int(k)]
    num = input().strip()
    result = []
    for i in range(n - k):
        multiply = 1
        for j in num[i:i + k]:
            multiply *= int(j)
        result.append(multiply)
    print(max(result))

#!/bin/python3
import sys

t = int(input().strip())
for a0 in range(t):
    n,k = input().strip().split(' ')
    n,k = [int(n),int(k)]
    num = input().strip()   #this is a string
    result = []
    for i in range(n-k):
        multiply = 1
        for j in num[i:i+k]:
            multiply *= int(j)
        result.append(multiply)
    print(max(result))
