#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<cmath>
using namespace std;



int main()
{
    int t;
    cin >> t;
    for(int T = 0; T < t; ++T)
    {
        int n, k;
        cin >> n >> k;
        string s, s1;
        cin >> s;
        s1 = s;
        int start = 0;
        int finish = 0;
        for(int i = 0; i < s.size(); ++i)
            if(s[i] == '*')
            {

                start = i;
                break;
            }
        for(int i = s.size() - 1; i >= 0; --i)
            if(s[i] == '*')
            {

                finish = i;
                break;
            }
        if(start == finish)
        {
            cout << 1 << endl;
            continue;
        }
        s[start] = 'x';
        s[finish] = 'x';
        s1[start] = 'x';
        s1[finish] = 'x';

        int count_forward = 2;

        for(int i = start + k; i < finish; )
        {
            int j = i;
            while(s[j] != '*') j--;
            s[j] = 'x';
            i = j + k;
            count_forward++;
        }
        int count_back = 2;
        for(int i = finish - k; i > start; )
        {
            int j = i;
            while(s1[j] != '*') j++;
            s1[j] = 'x';
            i = j - k;
            count_back++;
        }
        cout << min(count_forward, count_back) << endl;
    }







}
