#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
setbuf(stdout, NULL);
int TC;
int test_case;
scanf("%d", &TC);
for(test_case = 1; test_case <= TC; test_case++) {
int n;
vector<int> a;
scanf("%d", &n);
for(int i=0;i<n;i++){
int t;
scanf("%d", &t);
a.push_back(t);
}
sort(a.begin(),a.end());
int max=0;
for(int i=0;i<n;i++)
if(max<a[i]+n-i) max=a[i]+n-i;
int cnt=0;
for(int i=0;i<n;i++)
if(max<=a[i]+n) cnt++;
printf("Case #%d\n%d\n", test_case, cnt);
}
return 0;
}