/*

  AUTHOR:    nit1n
  CREATED:   27.03.2021 21:49:15

*/
#include<bits/stdc++.h>
#define int long long
using namespace std ;


signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL) ;

	int tt;
	cin >> tt ;
	while(tt--){
		int n , k ;
		cin >> n >> k;
		string s ;
		cin >> s; 
		int ans = 0 ;
		int l = 0 , r = n ; 
		for(int i = 0; i <n ; ++i){
			if(s[i] == '*'){
				l = i ; 
				ans++ ; 
				break ; 
			}
		}
		for(int i =n-1 ; i > l  ; --i){
			if(s[i] == '*'){ 
				r = i ; 
				break ; 
			}
		}
		if(r ==n) r = l ;
	    int x = l, prev = l ;
	    while(x < r){
	    	int j = min(x+k ,r) ;
	    	while(s[j] != '*'){
	   			j-- ; 
	    	}
	    	s[j] = 'X' ; 
	    	x = j ; 
	    	ans++ ; 
	    }
	    cout << ans << '\n' ; 

	}
}
