#include<bits/stdc++.h>
using namespace std;
#define ll int64_t
#define ul unsigned long long int
#define vi vector<int>
#define vl vector<int64_t>
#define all(x) x.begin(),x.end()
#define pb push_back
#define fo(x,a,b) for(int x=a; x<b; x++)
#define rfo(x,a,b) for(int x=a; x>=b; x--)
#define fi first
#define sec second
#define mp make_pair
int sgn(int x) { return x>0 ? 1 : ( x<0 ? -1 : 0); }
typedef pair<int,int> pairs;
double pi = 3.14159265358979323846;
ll mod = 1000000007;
int main()
{
#ifdef _DEBUG
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ios_base::sync_with_stdio(0);
cin.tie(0);
ll t;
cin>>t;
fo(z,1,t+1)
{
ll n,k;
cin>>n>>k;
vi a(n);
fo(i,0,n) cin>>a[i];
int ans=0,m=k;
fo(i,0,n)
{
if(a[i]==m)
{
m--;
if(m==0) {ans++; m=k;}
}
else m=k;
}
cout<<"Case #"<<z<<": "<<ans<<"\n";
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBsbCBpbnQ2NF90CiNkZWZpbmUgdWwgdW5zaWduZWQgbG9uZyBsb25nIGludAojZGVmaW5lIHZpIHZlY3RvcjxpbnQ+CiNkZWZpbmUgdmwgdmVjdG9yPGludDY0X3Q+CiNkZWZpbmUgYWxsKHgpIHguYmVnaW4oKSx4LmVuZCgpCiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgZm8oeCxhLGIpIGZvcihpbnQgeD1hOyB4PGI7IHgrKykKI2RlZmluZSByZm8oeCxhLGIpIGZvcihpbnQgeD1hOyB4Pj1iOyB4LS0pCiNkZWZpbmUgZmkgZmlyc3QKI2RlZmluZSBzZWMgc2Vjb25kCiNkZWZpbmUgbXAgbWFrZV9wYWlyCmludCBzZ24oaW50IHgpIHsgcmV0dXJuIHg+MCA/IDEgOiAoIHg8MCA/IC0xIDogMCk7IH0KdHlwZWRlZiBwYWlyP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