/*...................................................................*
 *............___..................___.....____...______......___....*
 *.../|....../...\........./|...../...\...|.............|..../...\...*
 *../.|...../.....\......./.|....|.....|..|.............|.../........*
 *....|....|.......|...../..|....|.....|..|............/...|.........*
 *....|....|.......|..../...|.....\___/...|___......../....|..___....*
 *....|....|.......|.../....|...../...\.......\....../.....|./...\...*
 *....|....|.......|../_____|__..|.....|.......|..../......|/.....\..*
 *....|.....\...../.........|....|.....|.......|.../........\...../..*
 *..__|__....\___/..........|.....\___/...\___/.../..........\___/...*
 *...................................................................*
 */
 
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF 1000000000000000000

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int tt=1;
	cin >> tt;
	while(tt--)
	{
		int n,k;
		cin >> n >> k;
		string s;
		cin >> s;
		int prev[n];
		int curr=-1;
		for(int i=0;i<n;i++)
		{
		    if(s[i]=='*')
		        curr=i;
		    prev[i]=curr;
		}
		int ans=1;
		for(int i=0;i<n;i++)
		{
		    if(s[i]=='*')
		    {
		        int j=i;
		        while(j<curr)
		        {
		            if(j+k>=n)
		            {
		                ans++;
		                break;
		            }
		            j=prev[j+k];
		            ans++;
		        }
		        break;
		    }
		}
		cout << ans << '\n';
	}
	return 0;
}