#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <iomanip>
#define lli long long
using namespace std;
 


int t, n, k;
string a, b;
int main(){
    cin >> t;
    while(t--){
        cin >> n >> k;
        cin >> a;
        int idx, edx;
        for(int i = 0; i < n; i++){
            if(a[i] == '*'){
                idx = i;
                break;
            }
           
        }
        for(int i = 0; i < n; i++){
            if(a[i] == '*'){
                edx = i;
            }
           
        }
        int ans;
        if(edx-idx <= k){
            if(edx == idx){
                cout << 1 << endl;
            }
            else{
                cout << 2 << endl;
            }
            continue;
        }
        ans = 2;
        while(abs(edx-idx) > k){
            int st1 = edx;
            int st2 = idx;
            int it1 =edx;
            int go1 = edx-k;
            while(it1 >= max(0,go1)){
                if(a[it1] == '*'){
                    edx = it1;
                }
                it1--;
            }
            it1 = idx;
            go1 = idx+k;

            while(it1 <= min(n-1, go1)){
                if(a[it1] == '*'){
                    idx = it1;
                }
                it1++;
            }

            if(abs(st1-idx) <= k){
                ans++;
                break;
            }
            else if(abs(st2-edx) <= k){
                ans++;
                break;
            }
            else if(abs(idx - edx) <= k){
                ans+=2;
                break;
            }
            else{
                ans+=2;
            }

            
        }
      
        cout << ans << endl;
        
    }
}