<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 255, 255);">
</span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 255, 255);">题目描述</span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 255, 255);">
</span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 255, 255);">题目描述</span>
输入
输出
示例输入
3 1 1 10 2 954 723
示例输出
1 45 3557658
提示
来源
山东省第二届ACM大学生程序设计竞赛
</pre><pre code_snippet_id="1639919" snippet_file_name="blog_20160409_3_8620377" name="code" class="cpp">
#include <iostream>
#include <cstring>
#include <string>
#include <stdio.h>
using namespace std;
int c[1002][1002];
void get()
{
memset(c,0,sizeof(c));
c[0][0]=c[1][0]=c[1][1]=1;
for(int i=2;i<1002;i++)
{
c[i][i]=c[i][0]=1;
for(int j=0;j<i;j++)
{
c[i][j]=(c[i-1][j-1]+c[i-1][j])%10000003;
}
}
}
int main()
{
get();
int n;
cin>>n;
while(n--)
{
int a,b;
cin>>a>>b;
cout<<c[a][b]<<endl;
}
return 0;
}