#include<bits/stdc++.h>
using namespace std;
int m,vis[10005],n,f[10005],ans,t;
void dfs(int x,int y)
{
if(x==0)
{
ans++;
return;
}
if(x<0||y<=0)
{
return;
}
for(int i=n-x;i<=n;i++)
{
dfs(x-i,y-1);
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie();
cout.tie();
cin>>t;
while(t--)
{
cin>>n>>m;
dfs(n,m);
cout<<ans<<"\n";
}
return 0;
}
不想用题解那种,想用爆枚写但是没法去重,大佬看看