求组合数模版
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<queue>
#include<vector>
#define LL long long
using namespace std;
LL n,m;
LL Cnm(LL n,LL m)
{
if(m>n/2)
m=n-m;
LL a=1,b=1;
for(int i=1; i<=m; i++)
{
a*=n+1-i;
b*=i;
if(a%b==0)
{
a/=b;
b=1;
}
}
return a/b;
}
int main()
{
while(scanf("%I64d %I64d",&n,&m)&&n)
{
printf("%I64d\n",Cnm(n,m));
}
return 0;
}