zxy0416 • 10天前
using namespace std;
int f(int m, int n) {
if (m == 1 || m == 0 || n == 1) {
return 1;
}
if (n <= 0) {
return 0;
}
return f(m - n, n) + f(m, n - 1);
}
int main() {
int n, m, t;
cin >> t;
while (t--) {
cin >> m >> n;
if(n==0){
break;
}
cout << f(m, n) << endl;
}
return 0;
}
评论:
请先登录,才能进行评论