#include <iostream>
using namespace std;
const int N = 200010;
int q[N];
int main()
{
int T,n,k;
cin >> T;
for(int t=1;t<=T;t++) {
cin >> n >> k;
int res = 0;
for(int i=0;i<n;i++) cin >> q[i];
for(int i=0,j=0,s=0;i<n;i++) {
if(q[i] == k) {
j = i;
s = k;
}
if(q[j] -q[i] == 1 && s-q[i] == 1 && i-j == 1) {
j++;
s--;
}
if(s == 1) {
res++;
s = 0;
}
}
printf("Case #%d: %d\n",t,res);
}
return 0;
}