#include<iostream>
using namespace std;
![](http://www.cppblog.com/Images/OutliningIndicators/None.gif)
int dp[31][31];
![](http://www.cppblog.com/Images/OutliningIndicators/None.gif)
int main()
![](http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif)
{
int m,n;
int cas = 1;
while(cin>>m>>n)
![](http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
if(m == 0 && n == 0)
break;
int i,j;
for(i = 0 ; i <= m;i++)
dp[i][0] = i;
for(i = 0;i <= n;i++)
dp[0][i] = 0;
for(i = 1;i <= m;i++)
for(j = 1;j <= n;j++)
![](http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
dp[i][j] = dp[i-1][j-1] + 1 + dp[i-1][j];
}
cout<<"Case "<<cas++<<": "<<dp[m][n]<<endl;
}
return 0;
}