#pragma GCC optimise ("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,abm,mmx,popcnt,avx,avx2,tune=native")
#pragma comment(linker,"/STACK:128777216")
#include<bits/stdc++.h>
using namespace std;

#define all(h) h.begin(), h.end()
#define int long long

int solve (const string& s, int i, int j, int k){
    int ans=i!=j? 2 : 1;
    if (j-i<=k) return ans;
    int ni=i,nj=j;
    for (int l=i; l<=i+k && l<j; ++l){
        if (s[l]=='*'){
            ni=l;
        }
    }
    if (j-ni<=k) return ans+1;
    for (int l=j; l>=j-k && l>i; --l){
        if (s[l]=='*'){
            nj=l;
        }
    }
    if (nj-i<=k) return ans+1;
    return ans+solve(s,ni,nj,k);
}

signed main (){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int test_case=1;
    cin >> test_case;
    while (test_case--) {
        int n,k;
        cin >> n >> k;
        string s;
        cin >> s;
        int i=0,j=n-1;
        for (int k=0; k<n; ++k){
            if (s[k]=='*') {
                i=k;
                break;
            }
        }
        for (int k=n-1; k>-1; --k){
            if (s[k]=='*'){
                j=k;
                break;
            }
        }
        cout << solve(s,i,j,k) << '\n';
    }
    return 0;
}