QAQ
其实就是在大的里面选小的方案数
#include <cstdio>
#include <string>
#include <algorithm>
#include <iostream>
#define ll long long
using namespace std;
ll yh[2001][2001];
const int mod=1e9+7;
void cf()
{
for(int i=0;i<=1005;i++) yh[i][i]=1,yh[i][0]=1;
for(int i=1;i<=1005;i++) for(int j=1;j<i;j++) yh[i][j]=(yh[i-1][j-1]+yh[i-1][j])%mod;
}
int main()
{
int t;
scanf("%d",&t);
cf();
while(t--)
{
int n,m;
scanf("%d%d",&n,&m);
if(n==m)
{
printf("1\n");
continue;
}
printf("%d\n",yh[max(n,m)][min(n,m)]%mod);
}
}