#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
typedef pair <int, int> PII;
const int MaxN=2e5+7;

int n,m,l;
int a[MaxN];

int main(){
    int t,cas=0;
    scanf("%d",&t);
    while (t--){
        scanf("%d%d%d",&n,&m,&l);
        for (int i=0; i<n; i++) scanf("%d",a+i);
        a[n++]=m; a[n++]=0;
        sort(a,a+n);
        int frog=-l, cnt=-1, step=0;
        for (int i=0; i<n; i++){
            if (frog+l>=a[i]){
                while (i+1<n && frog+l>=a[i+1]) i++;
                step=a[i]-frog;
                if (step==0) step=l;
                frog=a[i]; cnt++;
                continue;
            }
            int tmp=frog+(l-step)+1;
            int u=(a[i]-tmp)/(l+1);
            int v=(a[i]-frog)/(l+1);
            if (u==v){
                frog+=v*(l+1);
                cnt+=u+v;
            }
            else{
                frog=tmp+u*(l+1);
                cnt+=u+v;
            }
            i--;
        }
        printf("Case #%d: %d\n",++cas,cnt);
    }
	return 0;
}
