#include<iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int counter(int x,int y) {
if(y==1 || x==0) { return 1; }
if(x<y) return counter(x, x);
return counter(x,y-1) + counter(x-y,y);
}
int main()
{
int t, m, n;
cin>>t;
for(int i=0; i<t; i++) {
cin >> m >> n;
cout << counter(m,n) << endl;
}
return 0;
}
POJ1664(放苹果,感觉比较有意思)
最新推荐文章于 2022-01-28 17:30:21 发布