SHARE
TWEET

Untitled

a guest Feb 27th, 2020 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int a[101];
  6.  
  7. int main()
  8. {
  9.    // freopen("input.txt","r",stdin);
  10.     int n,m;
  11.  
  12.      cin >> m >> n;
  13.  
  14.       a[0] = 1;
  15.       for(int i = 1; i <= n; i++)
  16.         for(int j = 1; j <= m; j++)
  17.       {
  18.           a[i] = a[i-1];
  19.           if (i >= m) a[i] = a[i] + a[i-m];
  20.       }
  21.  
  22.        cout << a[n];
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top