当前位置: 代码迷 >> 编程 >> POJ1664(置苹果,感觉比较有意思)
  详细解决方案

POJ1664(置苹果,感觉比较有意思)

热度:6105   发布时间:2013-02-26 00:00:00.0
POJ1664(放苹果,感觉比较有意思)
#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;}