Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
6.3 kB
20
Indexable
Never


        /*
        ।। जय श्री राम ।।
        ।। जय हनुमान ।।
        */

        #include <bits/stdc++.h>
        #include <ext/pb_ds/assoc_container.hpp>
        #include <ext/pb_ds/tree_policy.hpp>

        using namespace std;
        using namespace __gnu_pbds;
        typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> osetint;
        typedef map<long long, long long> mll;
        typedef unordered_map<long long, long long> umll;
        typedef vector<long long> vi;
        typedef vector<char> vc;
        typedef vector<long long> vll;
        typedef vector<vector<long long>> vvi;
        typedef vector<string> vs;
        typedef pair<long long, long long> pii;
        typedef pair<long long, string> pic;
        typedef pair<string, long long > pci;
        typedef vector<pair<long long, long long>> vpii;
        typedef long long ll;
        typedef unsigned long long ull;
        typedef long double        lld;
        #define db(x) debug(x);
        #define check1 cout<<"YES"<<endl;
        #define check2 cout<<"NO"<<endl;
        #define check3 cout<<-1<<endl;
        #define int long long
        #define ff first
        #define ss second
        #define pb push_back
        #define mp make_pair
        #define pob pop_back
        #define findorder find_by_order
        #define orderkey order_of_key
        #define um unordered_map
        #define CHK 1e-9
        #define endl '\n'
        #define all(x) x.begin(), x.end()
        #define reverse(v) reverse(all(v));
        #define sorted(v) sort(v.begin(), v.end())
        #define reversesort(v) sort(v.begin(), v.end(),greater<int>())
        #define zerobefore(x) __builtin_clz(x)
        #define zeroafter(x) __builtin_ctz(x)
        #define ones(x) __builtin_popcount(x)
        #define parity(x) __builtin_parity(x)
        #define sz(x) x.size()
        #define len(x) x.length()
        #define prDouble(x)     cout << fixed << setprecision(9) << x
        #define goog(tno)       cout << "Case #" << tno <<": "
        #define fast_io         ios_base::sync_with_stdio(false);cin.tie(NULL)
        #define elasped_time   1.0 * clock() / CLOCKS_PER_SEC
        #define dfor(i,a,b) for(long long  i=a;i<b;i++)
        #define dforr(i,a,b) for(long long  i=a;i>=b;i--)
        #define rep(i,a,b)      for(int i = (a); i <= (b); (i)++)
        #define rev(i,a,b)      for(int i = (a); i >= (b); (i)--)
        int mod = 1e9 + 7;
        #define gcd(a,b)       __gcd(a,b)
        #define mem1(a)        memset(a,-1,sizeof(a))
        #define mem0(a)        memset(a,0,sizeof(a))
        //NEXT PERMUTATION next_permutation(all(v))
        // MAX ELEMENT
        #define maxele(v) *max_element(all(v))
        // MIN ELEMENT
        #define minele(v) *min_element(all(v))
        int sumarr(vi v) {int sum = 0; for (auto x : v) sum += x; return sum ;}
        int maxarr(vi v) {int mx = INT_MIN; for (auto x : v) mx = max(x, mx); return mx;}
        int minarr(vi v) {int mn = INT_MAX; for (auto x : v) mn = min(x, mn); return mn;}
        #define fauto(arr,x) for(auto x:arr)
        //UNIQUE ELEMENTS IN A ARRAY/VECTOR
        //v.erase(unique(all(v)), v.end());
        #define sc ' '
        #define input(arr, n)            \
            for (int i = 0; i < n; i++) \
            {                           \
                ll x;                   \
                cin >> x;               \
                arr.pb(x);              \
            }

        #define sumall(arr,sum)                                      \
            for (auto x:arr)                                    \
            {                                                   \
                sum+=x;                                           \
            }                                                   \


        #define print(arr)                                      \
            for (auto x:arr)                                    \
            {                                                   \
                cout << x << ' ' ;                              \
            }                                                   \
            cout << endl;
        // printf("%.6llf\n", ans);


        #define inputpair(arr, n)                   \
            for(int i=0;i<n;i++){                   \
                int a;                              \
                int b;                              \
                cin >> a >> b;                      \
                arr.push_back(make_pair(a, b));       \
                }                                   \


        #define printpair(arr)                                  \
            for (auto x:arr)                                    \
            {                                                   \
                cout << x.first << ' '<< x.second<< endl ;      \
            }                                                   \
            cout << endl;


        void init_code() {
            fast_io;
        #ifndef ONLINE_JUDGE
            freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); freopen("error.txt", "w", stderr);
        #endif
        }

        int n, m, x, y, z, k, l, a, b;
        const int INF = 1e9 + 7;
        const int vals = 1e6+1;

        int dp[1001001];
        int fun(vi& v,int i,int n){
            if(n==0) {return 1;}
            if(n<0) return 0;
            int ans=0;
            if(dp[n]!=-1) return dp[n];
            for(int k=1;k<=6;k++){
                ans+=fun(v,i,n-k);
                ans%=INF;
            }
            return dp[n]=ans;
        }


        void sarthak() {
            int one = 0, zer = 0, sum = 0, ans = 0, naruto = 0 ;
            string s;
            int n;
            cin>>n;
            memset(dp,-1,sizeof(dp));
            vi values;
            cout<<(fun(values,0,n));


            
            cerr << "Time: " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";

        }




        int32_t main()
        {
            init_code();
            int luffy = 1;
            // cin >> luffy;
            while (luffy--) {
                sarthak();
            }
            return 0;
        }