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 java.io.*;
  import java.util.Arrays;
  import java.util.*;
  import java.util.Scanner;
  import java.util.StringTokenizer;
  
  
  
  public class copy {
  
  
      public static boolean checker(long[] arr, long K, long diff) {
          long collect = 0;
          for (int i = 0; i < arr.length; i++) {
              if (arr[i] > diff)
                  collect += arr[i] - diff;
          }
  
          if (collect >= K)
              return true;
          else
              return false;
      }
  
      public static long search(long[] arr, long K, long R) {
          long l = 0;
          long r = R;
  
          while (l <= r) {
              long mid = (l + r) / 2;
  
              if (checker(arr, K, mid)) {
                  if (checker(arr, K, mid + 1))
                      l = mid + 1;
                  else
                      return mid;
              } else
                  r = mid - 1;
          }
          return -1;
      }
  
      static void sieveOfEratosthenes(int n, ArrayList<Integer> arr, ArrayList<Integer> arr1) {
          // Create a boolean array
          // "prime[0..n]" and
          // initialize all entries
          // it as true. A value in
          // prime[i] will finally be
          // false if i is Not a
          // prime, else true.
          boolean prime[] = new boolean[n + 1];
          for (int i = 0; i <= n; i++)
              prime[i] = true;
  
          for (int p = 2; p * p <= n; p++) {
              // If prime[p] is not changed, then it is a
              // prime
              if (prime[p] == true) {
  
                  // Update all multiples of p
                  for (int i = p * p; i <= n; i += p)
                      prime[i] = false;
              }
          }
  
          // Print all prime numbers
          int x = 0;
          for (int i = 2; i <= n; i++) {
              if (prime[i] == true) {
  
                  arr.add(i);
  
  
              }
  
          }
          System.out.println(arr.size());
      }
  
      public static boolean check(String s, int K, char ch) {
          ArrayList<Integer> arr = new ArrayList<>();
          for (int i = 0; i < s.length(); i++) {
              if (s.charAt(i) == ch)
                  arr.add(i);
          }
  //        if(K==1 && ch=='z')
  //            System.out.println(arr);
          if (arr.size() == 0)
              return false;
          if (arr.get(0) >= K)
              return false;
          if (s.length() - 1 - arr.get(arr.size() - 1) >= K)
              return false;
          for (int i = 1; i < arr.size(); i++) {
              if (arr.get(i) - arr.get(i - 1) > K)
                  return false;
          }
          return true;
      }
  
      public static int check(long N) {
          int sum = 0;
          while (N > 0) {
              sum += N % 10;
              N = N / 10;
          }
          return sum;
  
      }
  
      public static long call(long N) {
          long l = 1;
          long r = (long) Math.floor(Math.sqrt(N));
          while (l <= r) {
              long mid = (l + r) / 2;
              double left = N / (double) (mid) - mid;
              int right = check(mid);
              System.out.println(mid + " " + left + " " + right);
              if (mid == 10)
                  System.out.println(left + " " + right);
              if (left > right)
                  l = mid + 1;
              else if (right > left)
                  r = mid - 1;
              else
                  return mid;
          }
          return -1;
      }
  
      public static int path(ArrayList<ArrayList<Integer>> arr, int X, int parent, int[] gold, PriorityQueue<Integer> pq) {
          int max = 0;
          ArrayList<Integer> ch = new ArrayList<>();
          for (int i : arr.get(X)) {
              if (i != parent) {
                  ch.add(path(arr, i, X, gold, pq));
              }
          }
          Collections.sort(ch, Collections.reverseOrder());
          for (int i = 1; i < ch.size(); i++)
              pq.add(ch.get(i));
  
  
          if (ch.size() == 0)
              return gold[X];
          else
              return ch.get(0) + gold[X];
  
      }
  
      public static long fac(long N, long mod) {
          if (N == 0)
              return 1;
          return ((N % mod) * (fac(N - 1, mod) % mod)) % mod;
      }
  
      public static String form(char ch, int freq) {
          String s = "";
          for (int i = 1; i <= freq; i++)
              s += ch;
          return s;
      }
  
      static long power(long x, long y, long p) {
  
          // Initialize result
          long res = 1;
  
          // Update x if it is more than or
          // equal to p
          x = x % p;
  
          while (y > 0) {
  
              // If y is odd, multiply x
              // with result
              if (y % 2 == 1)
                  res = (res * x) % p;
  
              // y must be even now
              y = y >> 1; // y = y/2
              x = (x * x) % p;
          }
  
          return res;
      }
  
      // Returns n^(-1) mod p
      static long modInverse(long n, long p) {
          return power(n, p - 2, p);
      }
  
      // Returns nCr % p using Fermat's
      // little theorem.
      static long nCrModPFermat(long n, long r,
                                long p) {
  
          if (n < r)
              return 0;
          // Base case
          if (r == 0)
              return 1;
  
          // Fill factorial array so that we
          // can find all factorial of r, n
          // and n-r
  
  
  //        System.out.println(modInverse(fac(r,p),p));
  //        System.out.println(modInverse(fac(n-r,p),p));
          return ((fac(n, p) % p * (modInverse(fac(r, p), p)
                  % p)) % p * (modInverse(fac(n - r, p), p)
                  % p)) % p;
      }
  
      public static boolean check(long[] arr, long time, int M) {
          long sum = 0;
          int count = 0;
          for (int i = 0; i < arr.length; i++) {
              sum += arr[i];
              if (sum >= time) {
                  ++count;
                  sum = 0;
              }
          }
  
          if (sum >= time)
              ++count;
  
          return count >= M;
      }
  
      public static int check(ArrayList<Integer> arr, ArrayList<Integer> arr2) {
          int l = 0, r = 0, ans = 0;
          while (l < arr.size() && r < arr2.size()) {
              if (arr.get(l) < arr2.get(r))
                  ++l;
              else if (arr.get(l) > arr2.get(r))
                  ++r;
              else {
                  ++ans;
                  ++l;
                  ++r;
              }
          }
          return ans;
      }
  
  
      public static int find(int[] parent, int x) {
          if (parent[x] == x)
              return x;
          return find(parent, parent[x]);
      }
  
      public static void merge(int[] parent, int[] rank, int x, int y) {
          int x1 = find(parent, x);
          int y1 = find(parent, y);
          if (rank[x1] > rank[y1]) {
              parent[y1] = x1;
  
          } else if (rank[y1] > rank[x1]) {
              parent[x1] = y1;
          } else {
              parent[y1] = x1;
              rank[x1]++;
          }
      }
  
      public static int check(ArrayList<ArrayList<Integer>> arr, int e1, int e2, int N) {
          boolean[] visited = new boolean[N];
          visited[0] = true;
          int[] dist = new int[N];
          Queue<Integer> queue = new LinkedList<>();
          queue.add(0);
          Arrays.fill(dist, -1);
          dist[0] = 0;
          while (queue.size() > 0) {
              int x = queue.poll();
              for (int i : arr.get(x)) {
                  if (!visited[i] || (e1 == x && e2 == i)) {
                      System.out.println(x + " " + dist[x]);
                      dist[i] = dist[x] + 1;
                      visited[i] = true;
                      queue.add(i);
                  }
              }
  
          }
  
  
          return dist[N - 1];
      }
  
      static int N;
  
      static void rotate90Clockwise(String a[][]) {
  
          // Traverse each cycle
          for (int i = 0; i < N / 2; i++) {
              for (int j = i; j < N - i - 1; j++) {
  
                  // Swap elements of each cycle
                  // in clockwise direction
                  String temp = a[i][j];
                  a[i][j] = a[N - 1 - j][i];
                  a[N - 1 - j][i] = a[N - 1 - i][N - 1 - j];
                  a[N - 1 - i][N - 1 - j] = a[j][N - 1 - i];
                  a[j][N - 1 - i] = temp;
              }
          }
      }
  
  
      public static void moves(String s, int i, int[] movx, int[] movy, int x, int y) {
          if (i >= s.length())
              return;
          //System.out.println(x+" hello "+y);
          if (s.charAt(i) == 'L') {
              movy[i] = y;
              movx[i] = x - 1;
              moves(s, i + 1, movx, movy, x - 1, y);
          } else if (s.charAt(i) == 'R') {
              movy[i] = y;
              movx[i] = x + 1;
              moves(s, i + 1, movx, movy, x + 1, y);
          } else if (s.charAt(i) == 'U') {
              movy[i] = y + 1;
              movx[i] = x;
              moves(s, i + 1, movx, movy, x, y + 1);
          } else {
              movy[i] = y - 1;
              movx[i] = x;
              moves(s, i + 1, movx, movy, x, y - 1);
          }
  
      }
  
  
      public static boolean check(String s, int i, int x, int y, int obsx, int obsy) {
          if (i >= s.length()) {
              if (x == 0 && y == 0)
                  return true;
              return false;
          }
          boolean status1 = false, status2 = false, status3 = false, status4 = false;
          //System.out.println(x+" "+y+" "+obsx+" "+obsy+" "+s.charAt(i));
          if (s.charAt(i) == 'L') {
              if (x - 1 == obsx && y == obsy)
                  status1 = check(s, i + 1, x, y, obsx, obsy);
              else
                  status1 = check(s, i + 1, x - 1, y, obsx, obsy);
              //moves(s,i+1,movx,movy,x-1,y);
          } else if (s.charAt(i) == 'R') {
              if (x + 1 == obsx && y == obsy)
                  status2 = check(s, i + 1, x, y, obsx, obsy);
              else
                  status2 = check(s, i + 1, x + 1, y, obsx, obsy);
              //moves(s,i+1,movx,movy,x+1,y);
          } else if (s.charAt(i) == 'U') {
              if (y + 1 == obsy && x == obsx)
                  status3 = check(s, i + 1, x, y, obsx, obsy);
              else
                  status3 = check(s, i + 1, x, y + 1, obsx, obsy);
              //moves(s,i+1,movx,movy,x,y-1);
          } else {
              if (y - 1 == obsy && x == obsx)
                  status4 = check(s, i + 1, x, y, obsx, obsy);
              else
                  status4 = check(s, i + 1, x, y - 1, obsx, obsy);
          }
          return status1 || status2 || status3 || status4;
      }
  
      public static int mergeAndCount1(int[] arr, int l,
                                       int m, int r) {
  
          // Left subarray
          int[] left = Arrays.copyOfRange(arr, l, m + 1);
  
          // Right subarray
          int[] right = Arrays.copyOfRange(arr, m + 1, r + 1);
  
          int i = 0, j = 0, k = l, swaps = 0;
  
          while (i < left.length && j < right.length) {
              if (left[i] <= right[j])
                  arr[k++] = left[i++];
              else {
                  arr[k++] = right[j++];
                  swaps += (m + 1) - (l + i);
              }
          }
          while (i < left.length)
              arr[k++] = left[i++];
          while (j < right.length)
              arr[k++] = right[j++];
          return swaps;
      }
  
      // Merge sort function
      public static int mergeSortAndCount(int[] arr, int l,
                                          int r) {
  
          // Keeps track of the inversion count at a
          // particular node of the recursion tree
          int count = 0;
  
          if (l < r) {
              int m = (l + r) / 2;
  
              // Total inversion count = left subarray count
              // + right subarray count + merge count
  
              // Left subarray count
              count += mergeSortAndCount(arr, l, m);
  
              // Right subarray count
              count += mergeSortAndCount(arr, m + 1, r);
  
              // Merge count
              count += mergeAndCount1(arr, l, m, r);
          }
  
          return count;
      }
  
  
      public static boolean checker(String s1, String s2, int[] arr, int mid) {
          String s = "";
          int N = s1.length();
          boolean[] visited = new boolean[N];
          for (int i = 0; i <= mid; i++)
              visited[arr[i] - 1] = true;
          for (int i = 0; i < N; i++) {
              if (!visited[i])
                  s += s1.charAt(i);
          }
  
          int l = 0, index = -1;
          while (l < s2.length()) {
              if (s.indexOf(s2.charAt(l), index + 1) == -1)
                  return false;
              else {
                  index = s.indexOf(s2.charAt(l), index + 1);
                  ++l;
              }
          }
  
          return true;
      }
  
      public static int check(ArrayList<Integer> possible, int X, int start) {
          int l = start, r = possible.size() - 1;
  
          while (l <= r) {
              int mid = (l + r) / 2;
              if (possible.get(mid) > X) {
                  if (mid - 1 >= start && possible.get(mid - 1) > X)
                      r = mid - 1;
                  else
                      return mid;
              } else
                  l = mid + 1;
          }
  
          return -1;
      }
  
  
      public static int binse(ArrayList<Integer> arr, int start, int X, int N) {
          int l = start, r = N - 1;
          while (l <= r) {
              int mid = (l + r) / 2;
              if (arr.get(mid) - arr.get(start) <= X) {
                  if (mid + 1 < N && arr.get(mid + 1) - arr.get(start) <= X) {
                      l = mid + 1;
                  } else
                      return mid;
              } else
                  r = mid - 1;
          }
          return -1;
      }
  
  
      public static long dp(long[][] dp, int X, int[] arr, int index, long mod) {
          //System.out.println(index+" "+X);
          if (dp[index][X] != -1)
              return dp[index][X];
          int index1 = index + 1;
          int plus = (X - arr[index1] + 10) % 10;
          long ans = dp(dp, plus, arr, index - 1, mod) % mod;
          for (int i = 0; i < 10; i++) {
              if ((arr[index1] * i) % 10 == X)
                  ans = (ans % mod + dp(dp, i, arr, index - 1, mod) % mod) % mod;
          }
  
          dp[index][X] = ans;
          return ans;
  
  
      }
  
      public static long gcd(long a, long b) {
          if (b == 0)
              return a;
  
          return gcd(b, a % b);
      }
  
      public static int check(int x, ArrayList<ArrayList<Integer>> arr, int parent, int dist, long[] ans, int[] child) {
          ans[0] += dist;
          int c = 0;
          for (int i : arr.get(x)) {
              if (i != parent)
                  c += check(i, arr, x, dist + 1, ans, child);
          }
  
          child[x] = c + 1;
          return c + 1;
      }
  
      public static void check(int x, int parent, ArrayList<ArrayList<Integer>> arr, int[] child, long[] ans) {
          ans[x] = ans[parent] - (child[x]) + (arr.size() - child[x]);
  
          for (int i : arr.get(x)) {
              if (i != parent) {
                  check(i, x, arr, child, ans);
              }
          }
      }
  
      public static void leftRotatebyOne(int arr[], int n) {
          int i, temp;
          temp = arr[0];
          for (i = 0; i < n - 1; i++)
              arr[i] = arr[i + 1];
          arr[n - 1] = temp;
      }
  
      public static void tick(char[][] ch, int N, int M, int x, int y, int k, int[][] copy) {
  
          int c = 1, size = 0;
          //System.out.println(x+" "+y);
          while (x - c >= 0 && y - c >= 0 && y + c < M && ch[x - c][y - c] == '*' && ch[x - c][y + c] == '*') {
              ++size;
  
              ++c;
  
          }
          //System.out.println(size);
          c -= 1;
          while (c >= 0) {
  
              copy[x - c][y - c] = Math.max(copy[x - c][y - c], size);
              copy[x - c][y + c] = Math.max(copy[x - c][y + c], size);
  
              --c;
          }
  
  
      }
  
  
      public static void main(String[] args) throws IOException {
          Reader.init(System.in);
          BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
  
  
          int T = Reader.nextInt();
          A:
          for (int m = 1; m <= T; m++) {
              int N = Reader.nextInt();
              int M = Reader.nextInt();
              int k = Reader.nextInt();
              char[][] ch = new char[N][M];
              for (int i = 0; i < N; i++) {
  
                  String[] arr = Reader.next().split("");
                  for (int j = 0; j < M; j++)
                      ch[i][j] = arr[j].charAt(0);
  
              }
  
             
              int[][] copy = new int[N][M];
              for (int i = 0; i < N; i++)
                  Arrays.fill(copy[i], -1);
  
  
  
  
              for (int i = 0; i < N; i++) {
                  for (int j = 0; j < M; j++) {
  
                          if(ch[i][j]=='*')
                          {
  
                      tick(ch, N, M, i, j, k, copy);
  
  
                      }
  
  
                  }
              }
  
  
  
              for (int i = 0; i < N; i++) {
                  for (int j = 0; j < M; j++) {
                      if ((ch[i][j] == '*' && copy[i][j] < k)) {
  
                          output.write("NO" + "\n");
                          continue A;
                      }
                  }
  
              }
  
              output.write("YES" + "\n");
  
  
  
  
  
          }
          output.flush();
  
  
      }
  }
  
  
  
  class Reader {
      static BufferedReader reader;
      static StringTokenizer tokenizer;
  
      static void init(InputStream input) {
          reader = new BufferedReader(
                  new InputStreamReader(input));
          tokenizer = new StringTokenizer("");
      }
  
      static String next() throws IOException {
          while (!tokenizer.hasMoreTokens()) {
              tokenizer = new StringTokenizer(
                      reader.readLine());
          }
          return tokenizer.nextToken();
      }
  
      static int nextInt() throws IOException {
          return Integer.parseInt(next());
      }
  
      static long nextLong() throws IOException {
          return Long.parseLong(next());
      }
  
      static double nextDouble() throws IOException {
          return Double.parseDouble(next());
      }
  }
  
  class div
  {
      int x,y;
      div(int x1,int y1)
      {
          x=x1;
          y=y1;
      }
  }
  
  
  