#include<iostream>
using namespace std;
int n,f,a[100000]={1},toto;
int PR(int k)
{
if(k==f)
{
toto++;
}
}
void dfs(int s,int k,int sum)
{
for(int i=a[k-1];i<=n-sum;i++)
if(i<n&&k<=f&&s>=0)
{
a[k]=i;
s-=i;
if(s==0)PR(k);
else dfs(s,k+1,sum+i);
s+=i;
}
}
int main()
{
cin>>n>>f;
dfs(n,1,0);
cout<<toto;
}
我尽力了