#include<bits/stdc++.h>
using namespace std;
int a[1001][1001];
int main()
{
int t,m,n;
cin>>t;
for(int i=0;i<=10;i++)
for(int j=0;j<=10;j++)
{
a[i][j]=1;
if(i==0||j==1)a[i][j]=1;
else if(i>=j)a[i][j]=a[i][j-1]+a[i-j][j];
else a[i][j]=a[i][i];
}
while(t--)
{
cin>>m>>n;
cout<<a[m][n]<<endl;
}
return 0;
}
放苹果(2)
于 2018-02-26 14:35:11 首次发布