首页 > 代码库 > POJ1664

POJ1664

#include<iostream>using namespace std;int solve(int m,int n){    if(n==1||m==1||n==0)        return 1;    if(m<n)     return solve(m,m);    else        return solve(m,n-1)+solve(m-n,n);}int main(){    int t,m,n;    cin>>t;    while(t--){        cin>>m>>n;        cout<<solve(m,n)<<endl;    }}

 

POJ1664