description: 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.
  
  <image>
  
  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 print every letter in any case you want (so, for example, the strings yEs, yes, Yes, and YES will all be recognized as positive answers).
  
  Example
  
  Input
  
  
  8
  2 3 1
  *.*
  ...
  4 9 2
  *.*.*...*
  .*.*...*.
  ..*.*.*..
  .....*...
  4 4 1
  *.*.
  ****
  .**.
  ....
  5 5 1
  .....
  *...*
  .*.*.
  ..*.*
  ...*.
  5 5 2
  .....
  *...*
  .*.*.
  ..*.*
  ...*.
  4 7 1
  *.....*
  .....*.
  ..*.*..
  ...*...
  3 3 1
  ***
  ***
  ***
  3 5 1
  *...*
  .***.
  .**..
  
  
  Output
  
  
  NO
  YES
  YES
  YES
  NO
  NO
  NO
  NO
  
  Note
  
  The first sample test case consists of two asterisks neither of which can be independent ticks since ticks of size 0 don't exist.
  
  The second sample test case is already described in the statement (check the picture in the statement). This field can be obtained by drawing ticks of sizes 2 and 3, as shown in the figure.
  
  The field in the third sample test case corresponds to three ticks of size 1. Their center cells are marked with \color{blue}{blue}, \color{red}{red} and \color{green}{green} colors: *.*.  
  ---  
  *\color{blue}{*}**  
  .\color{green}{*}\color{red}{*}.  
  ....  
    
  The field in the fourth sample test case could have been obtained by drawing two ticks of sizes 1 and 2. Their vertices are marked below with \color{blue}{blue} and \color{red}{red} colors respectively: .....  
  ---  
  *...*  
  .*.*.  
  ..\color{red}{*}.*  
  ...\color{blue}{*}.  
    
  The field in the fifth sample test case can not be obtained because k = 2, and the last asterisk in the fourth row from the top with coordinates (4, 5) can only be a part of a tick of size 1.
  
  The field in the sixth sample test case can not be obtained because the top left asterisk (1, 1) can't be an independent tick, since the sizes of the ticks must be positive, and cannot be part of a tick with the center cell in the last row, since it is separated from it by a gap (a point, '.') in (2, 2).
  
  In the seventh sample test case, similarly, the field can not be obtained by the described process because the asterisks with coordinates (1, 2) (second cell in the first row), (3, 1) and (3, 3) (leftmost and rightmost cells in the bottom) can not be parts of any ticks.
solution: import bisect
  import heapq
  import math
  import collections
  import sys
  import copy
  from functools import reduce
  import decimal
  from io import BytesIO, IOBase
  import os
  import itertools
  import functools
  from types import GeneratorType
  
  sys.setrecursionlimit(10 ** 9)
  decimal.getcontext().rounding = decimal.ROUND_HALF_UP
  
  graphDict = collections.defaultdict
  
  queue = collections.deque
  
  
  ################## pypy deep recursion handling ##############
  # Author = @pajenegod
  def bootstrap(f, stack=[]):
      def wrappedfunc(*args, **kwargs):
          to = f(*args, **kwargs)
          if stack:
              return to
          else:
              while True:
                  if type(to) is GeneratorType:
                      stack.append(to)
                      to = next(to)
                  else:
                      stack.pop()
                      if not stack:
                          return to
                      to = stack[-1].send(to)
  
      return wrappedfunc
  
  
  ################## Graphs ###################
  class Graphs:
      def __init__(self):
          self.graph = graphDict(set)
  
      def add_edge(self, u, v):
          self.graph[u].add(v)
  
      def dfs_utility(self, nodes, visited_nodes):
          visited_nodes.add(nodes)
          for neighbour in self.graph[nodes]:
              if neighbour not in visited_nodes:
                  self.dfs_utility(neighbour, visited_nodes)
  
      def dfs(self, node):
          Visited = set()
          self.dfs_utility(i, Visited)
  
      def bfs(self, node, f_node):
          count = float("inf")
          visited = set()
          level = 0
          if node not in visited:
              queue.append([node, level])
              visited.add(node)
          flag = 0
          while queue:
              parent = queue.popleft()
              if parent[0] == f_node:
                  flag = 1
                  count = min(count, parent[1])
              level = parent[1] + 1
              for item in self.graph[parent[0]]:
                  if item not in visited:
                      queue.append([item, level])
                      visited.add(item)
          return count if flag else -1
          return False
  
      def solve(self, in_degree):
          c = 0
          tracker = queue()
          ans = graphDict(lambda: 1)
          for ii in range(n):
              if in_degree[ii + 1] == 0:
                  tracker.append(ii + 1)
          while tracker:
              node = tracker.popleft()
              c += 1
              for neighbour in self.graph[node]:
                  in_degree[neighbour] -= 1
                  if neighbour < node:
                      ans[neighbour] = max(ans[neighbour], ans[node] + 1)
                  else:
                      ans[neighbour] = max(ans[neighbour], ans[node])
                  if in_degree[neighbour] == 0:
                      tracker.append(neighbour)
          if c != n:
              return False
          else:
              return max(ans.values()) if len(ans.values()) > 0 else 1
          return "Send Help!!!!"
  
  
  ################### Tree Implementaion ##############
  class Tree:
      def __init__(self, data):
          self.data = data
          self.left = None
          self.right = None
  
  
  def inorder(node, lis):
      if node:
          inorder(node.left, lis)
          lis.append(node.data)
          inorder(node.right, lis)
      return lis
  
  
  def leaf_node_sum(root):
      if root is None:
          return 0
      if root.left is None and root.right is None:
          return root.data
      return leaf_node_sum(root.left) + leaf_node_sum(root.right)
  
  
  def hight(root):
      if root is None:
          return -1
      if root.left is None and root.right is None:
          return 0
      return max(hight(root.left), hight(root.right)) + 1
  
  
  ################## Union Find #######################
  class UF:
      """An implementation of union find data structure.
      It uses weighted quick union by rank with path compression.
      """
  
      def __init__(self, N):
          """Initialize an empty union find object with N items.
  
          Args:
              N: Number of items in the union find object.
          """
  
          self._id = list(range(N))
          self._count = N
          self._rank = [0] * N
  
      def find(self, p):
          """Find the set identifier for the item p."""
  
          id = self._id
          while p != id[p]:
              p = id[p]  # Path compression using halving.
          return p
  
      def count(self):
          """Return the number of items."""
  
          return self._count
  
      def connected(self, p, q):
          """Check if the items p and q are on the same set or not."""
  
          return self.find(p) == self.find(q)
  
      def union(self, p, q):
          """Combine sets containing p and q into a single set."""
  
          id = self._id
          rank = self._rank
  
          i = self.find(p)
          j = self.find(q)
          if i == j:
              return
  
          self._count -= 1
          if rank[i] < rank[j]:
              id[i] = j
          elif rank[i] > rank[j]:
              id[j] = i
          else:
              id[j] = i
              rank[i] += 1
  
      def add_roads(self):
          return set(self._id)
  
      def __str__(self):
          """String representation of the union find object."""
          return " ".join([str(x) for x in self._id])
  
      def __repr__(self):
          """Representation of the union find object."""
          return "UF(" + str(self) + ")"
  
  
  #################################################
  
  def rounding(n):
      return int(decimal.Decimal(f'{n}').to_integral_value())
  
  
  def factors(n):
      return set(reduce(list.__add__,
                        ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0), []))
  
  
  def p_sum(array):
      return list(itertools.accumulate(array))
  
  
  def diophantine(a: int, b: int, c: int):
      d, x, y = extended_gcd(a, b)
      r = c // d
      return r * x, r * y
  
  
  @bootstrap
  def extended_gcd(a: int, b: int):
      if b == 0:
          d, x, y = a, 1, 0
      else:
          (d, p, q) = yield extended_gcd(b, a % b)
          x = q
          y = p - q * (a // b)
  
      yield d, x, y
  
  
  ################################ <fast I/O> ###########################################
  BUFSIZE = 8192
  
  
  class FastIO(IOBase):
      newlines = 0
  
      def __init__(self, file):
          self._fd = file.fileno()
          self.buffer = BytesIO()
          self.writable = "x" in file.mode or "r" not in file.mode
          self.write = self.buffer.write if self.writable else None
  
      def read(self):
          while True:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              if not b:
                  break
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines = 0
          return self.buffer.read()
  
      def readline(self, **kwargs):
          while self.newlines == 0:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              self.newlines = b.count(b"\n") + (not b)
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines -= 1
          return self.buffer.readline()
  
      def flush(self):
          if self.writable:
              os.write(self._fd, self.buffer.getvalue())
              self.buffer.truncate(0), self.buffer.seek(0)
  
  
  class IOWrapper(IOBase):
      def __init__(self, file):
          self.buffer = FastIO(file)
          self.flush = self.buffer.flush
          self.writable = self.buffer.writable
          self.write = lambda s: self.buffer.write(s.encode("ascii"))
          self.read = lambda: self.buffer.read().decode("ascii")
          self.readline = lambda: self.buffer.readline().decode("ascii")
  
  
  sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
  
  
  #############################################<I/O Region >##############################################
  
  
  def inp():
      return sys.stdin.readline().strip()
  
  
  def map_inp(v_type):
      return map(v_type, inp().split())
  
  
  def list_inp(v_type):
      return list(map_inp(v_type))
  
  
  ######################################## Solution ####################################
  
  for _ in range(int(inp())):
      n, m, k = map_inp(int)
      arr = []
      for i in range(n):
          temp = list(inp())
          arr.append(temp)
      total = 0
      for i in range(n):
          for j in range(m):
              if arr[i][j] == "*":
                  total += 1
      visited = set()
      new = 0
      flag = 0
      for i in range(n - 1, -1, -1):
          for j in range(m - 1, -1, -1):
              if arr[i][j] == "*":
                  q, w = i, j
                  l = 1
                  prev = new
                  temp = set()
                  if w - l >= 0 and w + l < m and q - l >= 0:
                      e = 0
                      while arr[q - l][w - l] == "*" and arr[q - l][w + l] == "*":
  
                          if e == 0:
                              if (i, j) not in visited:
                                  new += 1
                                  visited.add((i, j))
                                  temp.add((i, j))
                              e = 1
                          if (q - l, w - l) not in visited:
                              new += 1
                              visited.add((q - l, w - l))
                              temp.add((q - l, w - l))
                          if (q - l, w + l) not in visited:
                              new += 1
                              visited.add((q - l, w + l))
                              temp.add((q - l, w + l))
                          l += 1
                          if w - l >= 0 and w + l < m and q - l >= 0:
                              continue
                          else:
                              break
                      if l - 1 < k and new - prev > 0:
                          for item in temp:
                              new -= 1
                              visited.remove(item)
      if new == total:
          print("YES")
      else:
          print("NO")
  