mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
25 lines
456 B
C++
25 lines
456 B
C++
|
#include<stdio.h>
|
||
|
#include<string.h>
|
||
|
__int64 C(__int64 n, __int64 m)
|
||
|
{
|
||
|
__int64 i, j;
|
||
|
if (m > n/2) m = n - m;
|
||
|
for (i = 1, j = 1;i <= m; i++)
|
||
|
{
|
||
|
j = j * (n + 1 - i) / i;
|
||
|
}
|
||
|
return j;
|
||
|
}
|
||
|
int main ()
|
||
|
{
|
||
|
int i,j,t;
|
||
|
__int64 k1,k2,k;
|
||
|
__int64 m,n;
|
||
|
while(scanf("%I64d%I64d",&n,&m)!=EOF&&n||m)
|
||
|
{
|
||
|
t=m>n?n:m;
|
||
|
printf("%I64d\n",C(m+n,t));
|
||
|
}
|
||
|
return 1;
|
||
|
}
|