Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 1e6 + 5;
- int n;
- int rec(int x) {
- if (x == n) return 1;
- if (x > n) return 0;
- int ans = 0;
- ans += rec(x + 1);
- ans += rec(x + 2);
- ans += rec(x + 3);
- ans += rec(x + 4);
- ans += rec(x + 5);
- ans += rec(x + 6);
- return ans;
- }
- int main(){
- cin >> n;
- cout << rec(0) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement