#include #include long long t,tt; char s[100010]; int k; int main() { int i,j,kk,kkk,l; scanf("%I64d",&t); for(tt=1;tt<=t;tt++) { scanf("\n"); gets(s); scanf("%d",&k); j=strlen(s); i=j%k; if(i==0) { i=j; kkk=j/k; } else { kkk=j/k+1; i*=kkk; } printf("Case #%I64d:\n",tt); for(l=0;l