递归-放苹果
//递归-放苹果 #include<stdio.h> 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,i; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%d%d",&m,&n); printf("%d\n",count(m,n)); } return 0; }