poj 1644 放苹果

#include<iostream>

using namespace std;

int count(int x,int y){

if(y==1||x==0) return 1;

if(x<y) return count(x,x);

return count(x,y-1)+count(x-y,y);

}

int main()

{

int t,m,n;

cin>>t;

for(int i=0;i<t;i++)

{

cin>>m>>n;

    cout<<count(m,n)<<endl;

    }

    while(1);

    return 0;

}

posted @ 2012-04-08 13:17  逝者*恋世  阅读(158)  评论(0编辑  收藏  举报