human
What is a Python code to find an example of the 4 × 9 box, with two ticks of sizes 2 and 3 given the following:
Casimir has a rectangular piece of paper with a checkered field of size n × m. Initially, all cells of the field are white.

Let us denote the cell with coordinates i vertically and j horizontally by (i, j). The upper left cell will be referred to as (1, 1) and the lower right cell as (n, m).

Casimir draws ticks of different sizes on the field. A tick of size d (d > 0) with its center in cell (i, j) is drawn as follows: 

  1. First, the center cell (i, j) is painted black. 
  2. Then exactly d cells on the top-left diagonally to the center and exactly d cells on the top-right diagonally to the center are also painted black. 
  3. That is all the cells with coordinates (i - h, j ± h) for all h between 0 and d are painted. In particular, a tick consists of 2d + 1 black cells. 


An already painted cell will remain black if painted again. Below you can find an example of the 4 × 9 box, with two ticks of sizes 2 and 3.


You are given a description of a checkered field of size n × m. Casimir claims that this field came about after he drew some (possibly 0) ticks on it. The ticks could be of different sizes, but the size of each tick is at least k (that is, d ≥ k for all the ticks).

Determine whether this field can indeed be obtained by drawing some (possibly none) ticks of sizes d ≥ k or not.

Input

The first line contains an integer t (1 ≤ t ≤ 100) — the number test cases.

The following lines contain the descriptions of the test cases. 

The first line of the test case description contains the integers n, m, and k (1 ≤ k ≤ n ≤ 10.
1 ≤ m ≤ 19) — the field size and the minimum size of the ticks that Casimir drew. The following n lines describe the field: each line consists of m characters either being '.' if the corresponding cell is not yet painted or '*' otherwise.

Output

Print t lines, each line containing the answer to the corresponding test case. The answer to a test case should be YES if the given field can be obtained by drawing ticks of at least the given size and NO otherwise.

You may...

def
assistant
#Here is Python code to find an example of the 4 × 9 box, with two ticks of sizes 2 and 3.
naiveSolve():
    
    
    
    return


def solve():
    
    
    
    return


def main():
    
    t=int(input())
    allans=[]
    for _ in range(t):
        n,m,k=readIntArr()
        grid=[]
        for __ in range(n):
            grid.append(input())
        
        arr=[['.' for __ in range(m)] for ___ in range(n)]
        for i in range(n):
            for j in range(m):
                if grid[i][j]=='*':
                    d=0
                    i1=i
                    j1=j2=j
                    while i1-1>=0 and j1-1>=0 and j2+1<m\
                        and grid[i1-1][j1-1]==grid[i1-1][j2+1]=='*':
                        d+=1
                        i1-=1
                        j1-=1
                        j2+=1
                    if d>=k:
                        i1=i;
                        j1=j2=j
                        for __ in range(d+1):
                            arr[i1][j1]=arr[i1][j2]='*'
                            i1-=1
                            j1-=1
                            j2+=1
        ans='YES'
        for i in range(n):
            for j in range(m):
                if grid[i][j]!=arr[i][j]:
                    ans='NO'
        allans.append(ans)
                    
        
    multiLineArrayPrint(allans)
    
    return

import sys
# input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)
input=lambda: sys.stdin.readline().rstrip("\r\n") #FOR READING STRING/TEXT INPUTS.

def oneLineArrayPrint(arr):
    print(' '.join([str(x) for x in arr]))
def multiLineArrayPrint(arr):
    print('\n'.join([str(x) for x in arr]))
def multiLineArrayOfArraysPrint(arr):
    print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))
 
def readIntArr():
    return [int(x) for x in input().split()]
# def readFloatArr():
#     return [float(x) for x in input().split()]
 
def makeArr(defaultValFactory,dimensionArr): # eg. makeArr(lambda:0,[n,m])
    dv=defaultValFactory;da=dimensionArr
    if len(da)==1:return [dv() for _ in range(da[0])]
   ...