POJ 1664 放苹果

 1 #include<iostream>
 2 using namespace std;
 3 int f(int m,int n)
 4 {
 5     if(m==0||n==1)
 6     return 1;
 7     if(m<n)
 8     return f(m,m);
 9     else return f(m-n,n)+f(m,n-1);
10 }
11 int main()
12 {
13     int n,m,t;
14     cin>>t;
15     while(t--)
16     {
17         cin>>m>>n;
18         cout<<f(m,n)<<endl;
19     }
20     return 0;
21 }
View Code
原文地址:https://www.cnblogs.com/huzhenbo113/p/3641480.html