fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. const int Mod=998244353;
  5.  
  6. int count(int n,int m){
  7. if (n==0 || m==1) return 1;
  8. if(n<0 || m<=0) return 0;
  9. return count(n,m-1)+count(n-m,n-m);
  10. }
  11.  
  12. void solve() {
  13. int n,m;
  14. cin >> n >> m;
  15. cout << count(n,m);
  16. }
  17.  
  18. int main(){
  19. ios::sync_with_stdio(false);
  20. cin.tie(nullptr);
  21.  
  22. /*int t;
  23.   cin >> t;
  24.   while (t--)*/ solve();
  25.  
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0.01s 5264KB
stdin
9 5
stdout
48