dp 记忆化搜索
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <vector>
//#include <sstream>
#include <string>
#include <cstring>
#include <algorithm>
//#include <iostream>
#define maxn 10010
#define INF 0x7fffffff
#define inf 10000000
#define ull unsigned long long
#define ll long long
using namespace std; int d[30][30][360];
int dp(int now, int L, int S)
{
if(L < 0 || S < 0) return 0;
int &ans = d[now][L][S];
if(ans >= 0) return ans;
if(L == 0 && S == 0) return ans = 1;
ans = 0;
for(int i = now; i <= 26; ++ i) ans += dp(i+1, L-1, S-i);
return ans;
}
int main()
{
int L, S, ca = 1;
while(scanf("%d%d", &L, &S) == 2 && S+L)
{
memset(d, -1, sizeof(d));
if(L > 26 || S > 351) printf("Case %d: 0\n", ca++);
else printf("Case %d: %d\n", ca++, dp(1, L, S));
}
return 0;
}