1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 5 typedef long long ll; 6 ll solve(int n,int k){ 7 if(n<k)return 0; 8 if(n==k||k==1)return 1; 9 return solve(n-1,k-1)+solve(n-1,k)*k; 10 } 11 int main(){ 12 int n,k; 13 cin>>n>>k; 14 cout<<solve(n,k); 15 return 0; 16 }