include iostream using namespace std long long cnk long long long long

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;
long long cnk(long long n, long long k)
{
long long res = 1;
if (k > n - k) k = n - k;
for(long long i = 1; i <= k; i++)
res = res * (n - i + 1) / i;
return res;
}
int main()
{
long long x,y;
while(cin>>x>>y&&(x||y))
{
cout << cnk(x+y,x) << endl;
}
}