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.util.ArrayList;
  import java.io.BufferedReader;
  import java.io.FileReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.StringTokenizer;
  import java.util.Arrays;
  import java.util.Random;
  import java.io.FileWriter;
  import java.io.PrintWriter;
  /*
      Solution Created: 18:32:06 28/09/2021
      Custom Competitive programming helper.
  */
  
  public class Main {
  	static int n,m,k;
  	static char[][] a;
  	public static void solve() {
  		n = in.nextInt(); m = in.nextInt(); k = in.nextInt();
  		a = new char[n][];
  		for(int i = 0; i<n; i++) a[i] = in.nca();
  		ArrayList<Integer> points = new ArrayList<>();
  		for(int i = 0; i<n; i++) {
  			for(int j = 0; j<m; j++) {
  				int sz = is(i,j);
  				if(sz>k) {
  					points.add(i);
  					points.add(j);
  					points.add(sz);
  				}
  			}
  		}
  		for(int i = 0; i<points.size(); i+=3) {
  			clear(points.get(i),points.get(i+1),points.get(i+2));
  		}
  		boolean good = true;
  		for(int i = 0; i<n; i++) for(int j = 0; j<m; j++) if(a[i][j] == '*') good = false;
  		out.yesNo(good);
  	}
  	public static int is(int i, int j) {
  		int sz1 = 0, sz2 = 0;
  		{
  			int I = i, J = j;
  			while(I>=0 && J>=0) {
  				if(a[I][J]=='.') break;
  				sz1++;
  				I--;J--;
  			}
  		}
  		{
  			int I = i, J = j;
  			while(I>=0 && J<m) {
  				if(a[I][J]=='.') break;
  				sz2++;
  				I--;J++;
  			}
  		}
  		return Math.min(sz1, sz2);
  	}
  	public static void clear(int i, int j, int sz) {
  		{
  			int szT = sz;
  			int I = i, J = j;
  			while(I>=0 && J>=0 && szT-->0) {
  				a[I][J]='.';
  				I--;J--;
  			}
  		}
  		{
  			int szT = sz;
  			int I = i, J = j;
  			while(I>=0 && J<m&& szT-->0) {
  				a[I][J]='.';
  				I--;J++;
  			}
  		}
  	}
  	public static void main(String[] args) {
  		in = new Reader();
  		out = new Writer();
  		int t = in.nextInt();
  		while(t-->0) solve();
  		out.exit();
  	}
  	static Reader in; static Writer out;
  
  static class Reader {
  	static BufferedReader br;
  	static StringTokenizer st;
  	
  	public Reader() {
  		this.br = new BufferedReader(new InputStreamReader(System.in));
  	}
  	
  	public Reader(String f){
  		try {
  			this.br = new BufferedReader(new FileReader(f));
  		} catch (IOException e) {
  			e.printStackTrace();
  		}
  	}
  	
  	public int[] na(int n) {
  		int[] a = new int[n];
  		for (int i = 0; i < n; i++) a[i] = nextInt();
  		return a;
  	}
  
  	public double[] nd(int n) {
  		double[] a = new double[n];
  		for (int i = 0; i < n; i++) a[i] = nextDouble();
  		return a;
  	}
  	
  	public long[] nl(int n) {
  		long[] a = new long[n];
  		for (int i = 0; i < n; i++) a[i] = nextLong();
  		return a;
  	}
  
  	public char[] nca() {
  		return next().toCharArray();
  	}
  
  	public String[] ns(int n) {
  		String[] a = new String[n];
  		for (int i = 0; i < n; i++) a[i] = next();
  		return a;
  	}
  
  	public int nextInt() {
  		ensureNext();
  		return Integer.parseInt(st.nextToken());
  	}
  
  	public double nextDouble() {
  		ensureNext();
  		return Double.parseDouble(st.nextToken());
  	}
  
  	public Long nextLong() {
  		ensureNext();
  		return Long.parseLong(st.nextToken());
  	}
  
  	public String next() {
  		ensureNext();
  		return st.nextToken();
  	}
  	
  	public String nextLine() {
  		try {
  			return br.readLine();
  		} catch (Exception e) {
  			e.printStackTrace();
  			return null;
  		}
  	}
  	
  	private void ensureNext() {
  		if (st == null || !st.hasMoreTokens()) {
  			try {
  				st = new StringTokenizer(br.readLine());
  			} catch (IOException e) {
  				e.printStackTrace();
  			}
  		}
  	}
  }
  
  static class Util{
  		private static Random random = new Random();
  		static long[] fact;
  		
  		public static void initFactorial(int n, long mod) {
  			fact = new long[n+1];
  			fact[0] = 1;
  			for (int i = 1; i < n+1; i++) fact[i] = (fact[i - 1] * i) % mod;
  		}
  		
  		public static long modInverse(long a, long MOD) {
  			long[] gcdE = gcdExtended(a, MOD);
  			if (gcdE[0] != 1) return -1; // Inverted doesn't exist
  			long x = gcdE[1];
  			return (x % MOD + MOD) % MOD;
  		}
  		
  		public static long[] gcdExtended(long p, long q) {
  			if (q == 0) return new long[] { p, 1, 0 };
  			long[] vals = gcdExtended(q, p % q);
  			long tmp = vals[2];
  			vals[2] = vals[1] - (p / q) * vals[2];
  			vals[1] = tmp;
  			return vals;
  		}
  		
  		public static long nCr(int n, int r, long MOD) {
  			if (r == 0) return 1;
  			return (fact[n] * modInverse(fact[r], MOD) % MOD * modInverse(fact[n - r], MOD) % MOD) % MOD;
  		}
  		
  		public static long nCr(int n, int r) {
  			return (fact[n]/fact[r])/fact[n-r];
  		}
  		
  		public static long nPr(int n, int r, long MOD) {
  			if (r == 0) return 1;
  			return (fact[n] * modInverse(fact[n - r], MOD) % MOD) % MOD;
  		}
  		public static long nPr(int n, int r) {
  			return fact[n]/fact[n-r];
  		}
  		
  		public static boolean isPrime(int n) { 
  	        if (n <= 1) return false; 
  	        if (n <= 3) return true; 
  	        if (n % 2 == 0 || n % 3 == 0) return false; 
  	        for (int i = 5; i * i <= n; i = i + 6) 
  	            if (n % i == 0 || n % (i + 2) == 0) 
  	            return false; 
  	        return true; 
  	    }
  		
  	    public static boolean[] getSieve(int n) {
  	        boolean[] isPrime = new boolean[n+1];
  	        for (int i = 2; i <= n; i++) isPrime[i] = true;
  	        for (int i = 2; i*i <= n; i++) if (isPrime[i]) 
  	                for (int j = i; i*j <= n; j++) isPrime[i*j] = false;
  	        return isPrime;
  	    }
  	    
  	    static long pow(long x, long pow, long mod){
  	    	long res = 1;
  	    	x = x % mod;
  	    	if (x == 0) return 0;
  	    	while (pow > 0){
  	    		if ((pow & 1) != 0) res = (res * x) % mod;
  	        	pow >>= 1;
  	        	x = (x * x) % mod;
  	    	}
  	    	return res;
  	    }
  	    
  	    public static int gcd(int a, int b) { 
  	    	int tmp = 0;
  	    	while(b != 0) {
  	    		tmp = b;
  	    		b = a%b;
  	    		a = tmp;
  	    	}
  	    	return a;
  	    }
  	    
  	    public static long gcd(long a, long b) { 
  	    	long tmp = 0;
  	    	while(b != 0) {
  	    		tmp = b;
  	    		b = a%b;
  	    		a = tmp;
  	    	}
  	    	return a;
  	    }
  	    
  	    public static int random(int min, int max) {
  	    	return random.nextInt(max-min+1)+min;
  	    }
  	    
  		public static void dbg(Object... o) { 
  			System.out.println(Arrays.deepToString(o)); 
  		}
  		
  		public static void reverse(int[] s, int l , int r) {
  			for(int i = l; i<=(l+r)/2; i++) {
  				int tmp = s[i];
  				s[i] = s[r+l-i];
  				s[r+l-i] = tmp;
  			}
  	    }
  		
  		public static void reverse(int[] s) {
  			reverse(s, 0, s.length-1);
  	    }
  		
  		public static void reverse(long[] s, int l , int r) {
  			for(int i = l; i<=(l+r)/2; i++) {
  				long tmp = s[i];
  				s[i] = s[r+l-i];
  				s[r+l-i] = tmp;
  			}
  	    }
  		
  		public static void reverse(long[] s) {
  			reverse(s, 0, s.length-1);
  	    }
  		
  		public static void reverse(float[] s, int l , int r) {
  			for(int i = l; i<=(l+r)/2; i++) {
  				float tmp = s[i];
  				s[i] = s[r+l-i];
  				s[r+l-i] = tmp;
  			}
  	    }
  		
  		public static void reverse(float[] s) {
  			reverse(s, 0, s.length-1);
  	    }
  		
  		public static void reverse(double[] s, int l , int r) {
  			for(int i = l; i<=(l+r)/2; i++) {
  				double tmp = s[i];
  				s[i] = s[r+l-i];
  				s[r+l-i] = tmp;
  			}
  	    }
  		
  		public static void reverse(double[] s) {
  			reverse(s, 0, s.length-1);
  	    }
  		
  		public static void reverse(char[] s, int l , int r) {
  			for(int i = l; i<=(l+r)/2; i++) {
  				char tmp = s[i];
  				s[i] = s[r+l-i];
  				s[r+l-i] = tmp;
  			}
  	    }
  		
  		public static void reverse(char[] s) {
  			reverse(s, 0, s.length-1);
  	    }
  		
  		public static <T> void reverse(T[] s, int l , int r) {
  			for(int i = l; i<=(l+r)/2; i++) {
  				T tmp = s[i];
  				s[i] = s[r+l-i];
  				s[r+l-i] = tmp;
  			}
  	    }
  		
  		public static <T> void reverse(T[] s) {
  			reverse(s, 0, s.length-1);
  	    }
  		
  		public static void shuffle(int[] s) {
  	        for (int i = 0; i < s.length; ++i) {
  	            int j = random.nextInt(i + 1);
  	            int t = s[i];
  	            s[i] = s[j];
  	            s[j] = t;
  	        }
  	    }
  		
  	    public static void shuffle(long[] s) {
  	        for (int i = 0; i < s.length; ++i) {
  	            int j = random.nextInt(i + 1);
  	            long t = s[i];
  	            s[i] = s[j];
  	            s[j] = t;
  	        }
  	    }
  	    
  	    public static void shuffle(float[] s) {
  	        for (int i = 0; i < s.length; ++i) {
  	            int j = random.nextInt(i + 1);
  	            float t = s[i];
  	            s[i] = s[j];
  	            s[j] = t;
  	        }
  	    }
  	    
  	    public static void shuffle(double[] s) {
  	        for (int i = 0; i < s.length; ++i) {
  	            int j = random.nextInt(i + 1);
  	            double t = s[i];
  	            s[i] = s[j];
  	            s[j] = t;
  	        }
  	    }
  	    
  	    public static void shuffle(char[] s) {
  	        for (int i = 0; i < s.length; ++i) {
  	            int j = random.nextInt(i + 1);
  	            char t = s[i];
  	            s[i] = s[j];
  	            s[j] = t;
  	        }
  	    }
  	    
  	    public static <T> void shuffle(T[] s) {
  	        for (int i = 0; i < s.length; ++i) {
  	            int j = random.nextInt(i + 1);
  	            T t = s[i];
  	            s[i] = s[j];
  	            s[j] = t;
  	        }
  	    }
  	    
  		public static void sortArray(int[] a) {
  	        shuffle(a);
  	        Arrays.sort(a);
  	    }
  		
  		public static void sortArray(long[] a) {
  			shuffle(a);
  	        Arrays.sort(a);
  	    }
  		
  		public static void sortArray(float[] a) {
  			shuffle(a);
  	        Arrays.sort(a);
  	    }
  		
  		public static void sortArray(double[] a) {
  			shuffle(a);
  	        Arrays.sort(a);
  	    }
  		
  		public static void sortArray(char[] a) {
  			shuffle(a);
  	        Arrays.sort(a);
  	    }
  		
  		public static <T extends Comparable<T>> void sortArray(T[] a) {
  	        Arrays.sort(a);
  	    }
  	}
  
  static class Writer {
  	private PrintWriter pw;
  	public Writer(){
  		pw = new PrintWriter(System.out);
  	}
  	
  	public Writer(String f){
  		try {
  			pw = new PrintWriter(new FileWriter(f));
  		} catch (IOException e) {
  			e.printStackTrace();
  		}
  	}
  	
  	public void yesNo(boolean condition) {
  		println(condition?"YES":"NO");
  	}
  	
  	public void printArray(int[] a) {
  		for(int i = 0; i<a.length; i++) print(a[i]+" ");
  	}
  	
  	public void printlnArray(int[] a) {
  		for(int i = 0; i<a.length; i++) print(a[i]+" ");
  		pw.println();
  	}
  	
  	public void printArray(long[] a) {
  		for(int i = 0; i<a.length; i++) print(a[i]+" ");
  	}
  	
  	public void printlnArray(long[] a) {
  		for(int i = 0; i<a.length; i++) print(a[i]+" ");
  		pw.println();
  	}
  	
  	public void print(Object o) {
  		pw.print(o.toString());
  	}
  	
  	public void println(Object o) {
  		pw.println(o.toString());
  	}
  	
  	public void println() {
  		pw.println();
  	}
  	
  	public void flush() {
  		pw.flush();
  	}
  	public void exit() {
  		pw.close();
  	}
  }
  }
  