http://poj.org/problem?id=1942
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<ctime>
#include<deque>
#include<stack>
#include<bitset>
#include<cstdio>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<iomanip>
#include<numeric>
#include<sstream>
#include<utility>
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std ;
unsigned long long n , m , temp , sum = 0 , ans = 0 , i;
int main()
{
while( scanf( "%llu%llu" , &n , &m ) != EOF )
{
if( !n && !m )
break ;
ans = 1 ;
if( n > m )
swap( n , m ) ;
sum = n + m ;
for( i = 1 ; i <= n ; ++i )
{
ans = ans * ( sum - i + 1 ) / i ;
}
printf( "%llu\n" , ans ) ;
}
return 0;
}