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: //package Java;
  import java.io.*;
  import java.text.DecimalFormat;
  import java.util.*;
  import java.util.Map.Entry;
  
  public class Main {
  	static final PrintWriter out = new PrintWriter(System.out, true);
      static final FastScanner sc = new FastScanner();
      public static void main(String[] args)  {
      	int t=sc.nextInt();
      	while(t-->0) {
      		int n=sc.nextInt();
      		int m=sc.nextInt();
      		int d=sc.nextInt();
      		int a[][]=new int[n][m];
      		for(int i=0;i<n;i++) {
      			String y=sc.next();
      			for(int j=0;j<m;j++) {
      				a[i][j]=(y.charAt(j)=='*'?1:0);
      			}
      		}
      		boolean flag=true;
      		int v[][]=new int[n][m];
      		for(int i=0;i<n;i++) {
      			for(int j=0;j<m;j++) {
      				if(a[i][j]==1) {
      					int ii=i,jj=j,c1=0,c2=0;
      					while(ii>=0&&jj>=0&&a[ii][jj]==1) {
      						ii--;
      						jj--;
      						c1++;
      					}
      					ii=i;jj=j;
      					while(ii>=0&&jj<m&&a[ii][jj]==1) {
      						ii--;
      						jj++;
      						c2++;
      					}
      					int c=Math.min(c1, c2)-1;
  
      					ii=i;jj=j;int y=c;
      					while(ii>=0&&jj>=0&&a[ii][jj]==1&&y>=0) {
          					v[ii][jj]=Math.max(v[ii][jj],c);
      						ii--;
      						y--;
      						jj--;
      					}
      					ii=i;jj=j;y=c;
      					while(ii>=0&&y>=0&&jj<m&&a[ii][jj]==1) {
          					v[ii][jj]=Math.max(v[ii][jj],c);
      						ii--;
      						y--;
      						jj++;
      					}
      				}
      			}
      		}
      		for(int i=0;i<n;i++) {
      			for(int j=0;j<m;j++) {
  //    				System.out.print(v[i][j]+" ");
      				if(a[i][j]==1&&v[i][j]<d) {
      					flag=false;
      					break;
      				}
      			}
  //    			System.out.println();
      		}
      		if(flag==true) {
      			out.println("YES");
      		}else {
      			out.println("NO");
      		}
      	}
      	out.close();
      }
      static long Cr(int n, int r,int mod,long fac[],long inv[]) {
      	if(n<r) return 0L;
  		return fac[n]*(inv[r]*inv[n - r]%mod)%mod;
  
  //    	long fac[]=new long[100000];
  //    	long inv[]=new long[100000];
  //    	fac[0]=fac[1]=1;
  //    	fac[i]=modmul(fac[i-1],i,m);
  //		inv[i] =modpow(fac[i], m - 2,m);
  //    	long ans = 1;
  //	    ans *= (Cr(n-x,more,m,fac,inv)*fac[more])%m;
  //	    ans %= m;
  	}
  	  static void sieveOfEratosthenes(int n,int a[],boolean prime[])
  	    {
  	        for (int i = 0; i <= n; i++)
  	            prime[i] = true;
  	        	int ii=0;
  	        for (int p = a[ii];ii<n;ii++)
  	        {
  	            if (prime[p] == true)
  	            {
  	                for (int i = p * p; i <= n; i += p)
  	                    prime[i] = false;
  	            }
  	        }
  	    }
  	 static long modDivide(long a, long b, int m)
  	  {
  	      a = a % m;
  	      long inv = modInverse(b, m);
  	      if (inv == -1) return -1;
  	      else
  	      {
  	        long c = (inv * a) % m ;
  	        return c;
  	      }
  	  }
  	  static long modInverse(long a, int m)
  	    {
  	        long g = gcd(a, m);
  	        if (g != 1) return -1;
  	        else
  	        {
  	        	return modpow(a,m-2,m);
  	        }
  	    }
  	  public static double logx(long m,int x)
  	    {
  	        double result = (double)(Math.log(m) / Math.log(x));
  	  
  	        return result;
  	    }
  	     static double setPrecision(double ans,int k){
  	    	 double y=Math.pow(10,k);
  	    	 return Math.round(ans*y)/y;
  	     }
  	  public static double log2(double m)
  	    {
  	        double result = (double)(Math.log(m) / Math.log(2));
  	  
  	        return result;
  	    }
  	public static void sort(long[] arr){//because Arrays.sort() uses quicksort which is in worst O(n^2)
  		//Collections.sort() uses merge sort
  		ArrayList<Long> ttttt = new ArrayList<Long>();
  		for(long y: arr)ttttt.add(y);Collections.sort(ttttt);
  		for(int i=0; i < arr.length; i++)arr[i] = ttttt.get(i);
  	}
  	public static void sort(int[] arr){//because Arrays.sort() uses quicksort which is dumb
  		//Collections.sort() uses merge sort
  		ArrayList<Integer> ttttt = new ArrayList<>();
  		for(int y: arr)ttttt.add(y);Collections.sort(ttttt);
  		for(int i=0; i < arr.length; i++)arr[i] = ttttt.get(i);
  	}
  	static boolean check(double[] a,double m,int n,int k) {
  		int ans=0;
  		for(int i=0;i<n;i++) {
  			ans+=(Math.floor(a[i]/m));
  			if(ans>=k) return true;
  		}
  		return ans>=k;
  	}
  	     static boolean isKthBitSet(long n, int k) { 
  			if ((n & (1 << (k - 1))) > 0) 
  			return true;
  			else
  			return false;
  			
  		 } 
  	     static long modpow(long a,long b,int m) {
  	    	 if(b==0) return 1;
  	    	 if(b==1) return a;
  	    	 long ans=0;
  	    	 long t=modpow(a,b/2,m);
  	    	 ans=modmul(t,t,m);
  	    	 if(b%2!=0) ans=modmul(a,ans,m);
  	    	 return ans;
  	     }
  		static long modmul(long a,long b,int m) {
  			return mod(mod(a,m)*mod(b,m),m);
  		}
  		static long mod(long x,int m) {
  			return ((x%m)+m)%m;
  		}
  		 static int octaltodecimal(int deciNum)
  		    {
  		        int octalNum = 0, countval = 1;
  		        int dNo = deciNum;
  		        while (deciNum != 0) {
  		 
  		            // decimals remainder is calculated
  		            int remainder = deciNum % 8;
  		 
  		            // storing the octalvalue
  		            octalNum += remainder * countval;
  		 
  		            // storing exponential value
  		            countval = countval * 10;
  		            deciNum /= 8;
  		        }
  		       return octalNum;
  		    }
  		
  	  public static int floorSqrt(int x) 
  	    { 
  	        // Base Cases 
  	        if (x == 0 || x == 1) 
  	            return x; 
  	  
  	        // Do Binary Search for floor(sqrt(x)) 
  	        int start = 1, end = x, ans=0; 
  	        while (start <= end) 
  	        { 
  	            int mid = (start + end) / 2; 
  	  
  	            // If x is a perfect square 
  	            if (mid*mid == x) 
  	                return mid; 
  	  
  	            // Since we need floor, we update answer when mid*mid is 
  	            // smaller than x, and move closer to sqrt(x) 
  	            if (mid*mid < x) 
  	            { 
  	                start = mid + 1; 
  	                ans = mid; 
  	            } 
  	            else   // If mid*mid is greater than x 
  	                end = mid-1; 
  	        } 
  	        return ans; 
  	    } 
  		static int div(int n,int b) {
  			int g=-1;
  			for(int i=2;i<=Math.sqrt(n);i++) {
  				if(n%i==0&&i!=b) {
  					g=i;
  					break;
  				}
  			}
  			return g;
  		}
  	 
  	  
  	  public static long gcd(long a, long a2) 
  	    { 
  	        if (a == 0) 
  	            return a2; 
  	          
  	        return gcd(a2%a, a); 
  	    } 
  	   public static long lcm(int a, int b)  
  	  {  
  	     return (a*b)/gcd(a, b);  
  	  }  
  	   public static boolean isPrime1(int n) {
             if (n <= 1) {
                 return false;
             }
             if (n == 2) {
                 return true;
             }
             for (int i = 2; i <= Math.sqrt(n) + 1; i++) {
                 if (n % i == 0) {
                     return false;
                 }
             }
             return true;
         }
         public static boolean isPrime(int n) {
             if (n <= 1) {
                 return false;
             }
             if (n == 2) {
                 return true;
             }
             if (n % 2 == 0) {
                 return false;
             }
             for (int i = 3; i <= Math.sqrt(n) + 1; i = i + 2) {
                 if (n % i == 0) {
                     return false;
                 }
             }
             return true;
         }
  	      
         static class FastScanner {
             BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
             StringTokenizer strToken = new StringTokenizer("");
             String next() {
          	   while (!strToken.hasMoreTokens()) {
          		   try {
          			   strToken = new StringTokenizer(input.readLine()); 
          		   }  catch (IOException e) { 
          			    e.printStackTrace();
          			  } 
          	   } return strToken.nextToken(); 
          	}
             String nextLine() {
          	   String strrrrr = ""; try {
          		   strrrrr = input.readLine(); 
          	   } catch (IOException e) {
          			   e.printStackTrace(); 
          		}
          	   return strrrrr; 
             }
             int nextInt() {
          	   return Integer.parseInt(next()); 
          	}
             int[] nextIntArray(int n) {
          	   int[] a = new int[n]; 
          	   for (int i = 0; i < n; i++) a[i] = nextInt(); 
          	   return a; 
             }
             long nextLong() {
          	   return Long.parseLong(next()); 
          	}
             long[] nextLongArray(int n) {
          	   long[] a = new long[n];
          	   for (int i = 0; i < n; i++) a[i] = nextLong(); 
          	   return a; 
          	}
             double nextDouble() {
          	   return Double.parseDouble(next()); 
             }
         }
  }
  class DisjointSet {
      
      private int[] parent;
      private int[] rank;
      
      public DisjointSet(int n) {
          if (n < 0) throw new IllegalArgumentException();
          parent = new int[n];
          for(int i=0;i<n;i++) parent[i]=i;
          rank = new int[n];
      }
      
      public int find(int x) {
          if (parent[x] == x) return x;
          return parent[x] = find(parent[x]); // Path compression by halving.
      }
      
      // Return false if x, y are connected.
      public boolean union(int x, int y) {
          int rootX = find(x);
          int rootY = find(y);
          if (rootX == rootY) return false;
          
          // Make root of smaller rank point to root of larger rank.
          if (rank[rootX] < rank[rootY]) parent[rootX] = rootY;
          else if (rank[rootX] > rank[rootY]) parent[rootY] = rootX;
          else {
              parent[rootX] = rootY;
              rank[rootY]++;
          }
          
          return true;
      }
  }
  //
  //class Pair{
  //  int value;
  //  int distance;
  //  Pair(int value,int distance){
  //      this.value=value;
  //      this.distance=distance;
  //  }
  //  
  //}
  //class sortbydistance implements Comparator<Pair>{
  //
  //	@Override
  //	public int compare(Pair o1, Pair o2) {
  //		return o1.distance-o2.distance;
  //	}
  //	
  //}
  //class Solution
  //{
  //  static int[] dijkstra(int n, ArrayList<ArrayList<ArrayList<Integer>>> adj, int S)
  //  {
  //  	 PriorityQueue<Pair>set=new PriorityQueue<>(new sortbydistance());
  //      int dis[]=new int[n];
  //      Arrays.fill(dis,Integer.MAX_VALUE);
  //      dis[0]=0;
  //      while(set.isEmpty()==false) {
  //      	Pair p=set.poll();
  //      	int u=p.value;
  //      	for(int i=0;i<adj.get(u).size();i++) {
  //      		int v=adj.get(u).get(i).get(0);
  //      		int wt=adj.get(u).get(i).get(1);
  //      		if(dis[v]>dis[u]+wt) {
  //      			if(dis[v]!=Integer.MAX_VALUE) {
  //      				set.remove(new Pair(dis[v],v));
  //      			}
  //      			dis[v]=dis[u]+wt;
  //      			set.add(new Pair(v,dis[v]));
  //      		}
  //      		
  //      	}
  //      }
  //      
  //      
  //      return dis;
  //  }
  //}
  //