Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
const ll mod = 1e9 + 7;
ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
ll extended_gcd(ll a, ll b, ll &x, ll &y) {
    if (b == 0) { x = 1; y = 0; return a; }
    ll xx, yy;
    ll res = extended_gcd(b, a%b, xx, yy); x = yy; y = xx - yy * (a / b);
    return res;
}

const ll sz = 1e4 + 5;
vector<ll> fac(sz, 1);

// ll nCr(ll n, ll r) {
//     return ( ( ( (fac[n] * powmod(fac[n-r], mod-2)) % mod ) * powmod(fac[r], mod-2) ) % mod );
// }

// * ALways PASS arrays, strings etc to functions BY REFERENCE

// const ll sz = 1e6 + 6;
// vector<bool> p(sz, true);

ll res;

// void func(ll sm, ll st, map<ll,ll> &mpp, ll tot) {
//     if (sm < 0)
//         return;
//     if (sm == 0) {
//         ll ans = fac[tot];
//         for (auto it: mpp)
//             ans = (ans * powmod(fac[it.se], mod-2)) % mod;
//         res = (res + ans) % mod;
//         return;
//     }
    
//     for (ll i = st; i <= sm; i++) {
//         mpp[i] += 1;
//         func(sm-i, i, mpp, tot+1);
//         mpp[i] -= 1;
//     }
// }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // for (int i = 1; i < sz; i++)
    //     fac[i] = (fac[i-1] * i) % mod;
    
    // p[0] = p[1] = false;
    // for (ll i = 2; i*i <= sz; i++) if (p[i]) {
    //     for (ll j = i*i; j <= sz; j += i)
    //         p[j] = false;
    // }
    
    int t = 1;
    // cin >> t;

    while(t--) {
        ll sm;
        cin >> sm;
        
        // res = 0;
        // map<ll,ll> mpp;
        // func(sm, 3ll, mpp, 0ll);
        
        if (sm <= 2) {
            cout << 0 << endl;
            return 0;
        }
        else if (sm <= 5) {
            cout << 1 << endl;
            return 0;
        }
        
        vector<ll> dp(sm+1, 1);
        dp[0] = dp[1] = dp[2] = 0;
        
        for (int i = 6; i <= sm; i++) {
            for (int j = i-3; j >= 0; j--)
            dp[i] = (dp[i] + dp[j]) % mod;
        }
        
        cout << dp[sm] << endl;
    }
    
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
const ll mod = 1e9 + 7;
ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
ll extended_gcd(ll a, ll b, ll &x, ll &y) {
    if (b == 0) { x = 1; y = 0; return a; }
    ll xx, yy;
    ll res = extended_gcd(b, a%b, xx, yy); x = yy; y = xx - yy * (a / b);
    return res;
}

const ll sz = 1e4 + 5;
vector<ll> fac(sz, 1);

// ll nCr(ll n, ll r) {
//     return ( ( ( (fac[n] * powmod(fac[n-r], mod-2)) % mod ) * powmod(fac[r], mod-2) ) % mod );
// }

// * ALways PASS arrays, strings etc to functions BY REFERENCE

// const ll sz = 1e6 + 6;
// vector<bool> p(sz, true);

ll res;

// void func(ll sm, ll st, map<ll,ll> &mpp, ll tot) {
//     if (sm < 0)
//         return;
//     if (sm == 0) {
//         ll ans = fac[tot];
//         for (auto it: mpp)
//             ans = (ans * powmod(fac[it.se], mod-2)) % mod;
//         res = (res + ans) % mod;
//         return;
//     }
    
//     for (ll i = st; i <= sm; i++) {
//         mpp[i] += 1;
//         func(sm-i, i, mpp, tot+1);
//         mpp[i] -= 1;
//     }
// }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // for (int i = 1; i < sz; i++)
    //     fac[i] = (fac[i-1] * i) % mod;
    
    // p[0] = p[1] = false;
    // for (ll i = 2; i*i <= sz; i++) if (p[i]) {
    //     for (ll j = i*i; j <= sz; j += i)
    //         p[j] = false;
    // }
    
    int t = 1;
    // cin >> t;

    while(t--) {
        ll sm;
        cin >> sm;
        
        // res = 0;
        // map<ll,ll> mpp;
        // func(sm, 3ll, mpp, 0ll);
        
        if (sm <= 2) {
            cout << 0 << endl;
            return 0;
        }
        else if (sm <= 5) {
            cout << 1 << endl;
            return 0;
        }
        
        vector<ll> dp(sm+1, 1);
        dp[0] = dp[1] = dp[2] = 0;
        
        for (int i = 6; i <= sm; i++) {
            for (int j = i-3; j >= 0; j--)
            dp[i] = (dp[i] + dp[j]) % mod;
        }
        
        cout << dp[sm] << endl;
    }
    
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
const ll mod = 1e9 + 7;
ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
ll extended_gcd(ll a, ll b, ll &x, ll &y) {
    if (b == 0) { x = 1; y = 0; return a; }
    ll xx, yy;
    ll res = extended_gcd(b, a%b, xx, yy); x = yy; y = xx - yy * (a / b);
    return res;
}

const ll sz = 1e4 + 5;
vector<ll> fac(sz, 1);

// ll nCr(ll n, ll r) {
//     return ( ( ( (fac[n] * powmod(fac[n-r], mod-2)) % mod ) * powmod(fac[r], mod-2) ) % mod );
// }

// * ALways PASS arrays, strings etc to functions BY REFERENCE

// const ll sz = 1e6 + 6;
// vector<bool> p(sz, true);

ll res;

// void func(ll sm, ll st, map<ll,ll> &mpp, ll tot) {
//     if (sm < 0)
//         return;
//     if (sm == 0) {
//         ll ans = fac[tot];
//         for (auto it: mpp)
//             ans = (ans * powmod(fac[it.se], mod-2)) % mod;
//         res = (res + ans) % mod;
//         return;
//     }
    
//     for (ll i = st; i <= sm; i++) {
//         mpp[i] += 1;
//         func(sm-i, i, mpp, tot+1);
//         mpp[i] -= 1;
//     }
// }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // for (int i = 1; i < sz; i++)
    //     fac[i] = (fac[i-1] * i) % mod;
    
    // p[0] = p[1] = false;
    // for (ll i = 2; i*i <= sz; i++) if (p[i]) {
    //     for (ll j = i*i; j <= sz; j += i)
    //         p[j] = false;
    // }
    
    int t = 1;
    // cin >> t;

    while(t--) {
        ll sm;
        cin >> sm;
        
        // res = 0;
        // map<ll,ll> mpp;
        // func(sm, 3ll, mpp, 0ll);
        
        if (sm <= 2) {
            cout << 0 << endl;
            return 0;
        }
        else if (sm <= 5) {
            cout << 1 << endl;
            return 0;
        }
        
        vector<ll> dp(sm+1, 1);
        dp[0] = dp[1] = dp[2] = 0;
        
        for (int i = 6; i <= sm; i++) {
            for (int j = i-3; j >= 0; j--)
            dp[i] = (dp[i] + dp[j]) % mod;
        }
        
        cout << dp[sm] << endl;
    }
    
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
const ll mod = 1e9 + 7;
ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
ll extended_gcd(ll a, ll b, ll &x, ll &y) {
    if (b == 0) { x = 1; y = 0; return a; }
    ll xx, yy;
    ll res = extended_gcd(b, a%b, xx, yy); x = yy; y = xx - yy * (a / b);
    return res;
}

const ll sz = 1e4 + 5;
vector<ll> fac(sz, 1);

// ll nCr(ll n, ll r) {
//     return ( ( ( (fac[n] * powmod(fac[n-r], mod-2)) % mod ) * powmod(fac[r], mod-2) ) % mod );
// }

// * ALways PASS arrays, strings etc to functions BY REFERENCE

// const ll sz = 1e6 + 6;
// vector<bool> p(sz, true);

ll res;

// void func(ll sm, ll st, map<ll,ll> &mpp, ll tot) {
//     if (sm < 0)
//         return;
//     if (sm == 0) {
//         ll ans = fac[tot];
//         for (auto it: mpp)
//             ans = (ans * powmod(fac[it.se], mod-2)) % mod;
//         res = (res + ans) % mod;
//         return;
//     }
    
//     for (ll i = st; i <= sm; i++) {
//         mpp[i] += 1;
//         func(sm-i, i, mpp, tot+1);
//         mpp[i] -= 1;
//     }
// }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // for (int i = 1; i < sz; i++)
    //     fac[i] = (fac[i-1] * i) % mod;
    
    // p[0] = p[1] = false;
    // for (ll i = 2; i*i <= sz; i++) if (p[i]) {
    //     for (ll j = i*i; j <= sz; j += i)
    //         p[j] = false;
    // }
    
    int t = 1;
    // cin >> t;

    while(t--) {
        ll sm;
        cin >> sm;
        
        // res = 0;
        // map<ll,ll> mpp;
        // func(sm, 3ll, mpp, 0ll);
        
        if (sm <= 2) {
            cout << 0 << endl;
            return 0;
        }
        else if (sm <= 5) {
            cout << 1 << endl;
            return 0;
        }
        
        vector<ll> dp(sm+1, 1);
        dp[0] = dp[1] = dp[2] = 0;
        
        for (int i = 6; i <= sm; i++) {
            for (int j = i-3; j >= 0; j--)
            dp[i] = (dp[i] + dp[j]) % mod;
        }
        
        cout << dp[sm] << endl;
    }
    
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
const ll mod = 1e9 + 7;
ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
ll extended_gcd(ll a, ll b, ll &x, ll &y) {
    if (b == 0) { x = 1; y = 0; return a; }
    ll xx, yy;
    ll res = extended_gcd(b, a%b, xx, yy); x = yy; y = xx - yy * (a / b);
    return res;
}

const ll sz = 1e4 + 5;
vector<ll> fac(sz, 1);

// ll nCr(ll n, ll r) {
//     return ( ( ( (fac[n] * powmod(fac[n-r], mod-2)) % mod ) * powmod(fac[r], mod-2) ) % mod );
// }

// * ALways PASS arrays, strings etc to functions BY REFERENCE

// const ll sz = 1e6 + 6;
// vector<bool> p(sz, true);

ll res;

// void func(ll sm, ll st, map<ll,ll> &mpp, ll tot) {
//     if (sm < 0)
//         return;
//     if (sm == 0) {
//         ll ans = fac[tot];
//         for (auto it: mpp)
//             ans = (ans * powmod(fac[it.se], mod-2)) % mod;
//         res = (res + ans) % mod;
//         return;
//     }
    
//     for (ll i = st; i <= sm; i++) {
//         mpp[i] += 1;
//         func(sm-i, i, mpp, tot+1);
//         mpp[i] -= 1;
//     }
// }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // for (int i = 1; i < sz; i++)
    //     fac[i] = (fac[i-1] * i) % mod;
    
    // p[0] = p[1] = false;
    // for (ll i = 2; i*i <= sz; i++) if (p[i]) {
    //     for (ll j = i*i; j <= sz; j += i)
    //         p[j] = false;
    // }
    
    int t = 1;
    // cin >> t;

    while(t--) {
        ll sm;
        cin >> sm;
        
        // res = 0;
        // map<ll,ll> mpp;
        // func(sm, 3ll, mpp, 0ll);
        
        if (sm <= 2) {
            cout << 0 << endl;
            return 0;
        }
        else if (sm <= 5) {
            cout << 1 << endl;
            return 0;
        }
        
        vector<ll> dp(sm+1, 0);
        dp[0] = 1;
        
        for (int i = 3; i <= sm; i++) {
//            for (int j = i-3; j >= 0; j--)
            dp[i] = (dp[i-1] + dp[i-3]) % mod;
        }
        
        cout << dp[sm] << endl;
    }
    
	return 0;
}


Compiler output:
a.cc:106:10: error: redefinition of 'const long long int mod'
  106 | const ll mod = 1e9 + 7;
      |          ^~~
a.cc:9:10: note: 'const long long int mod' previously defined here
    9 | const ll mod = 1e9 + 7;
      |          ^~~
a.cc:107:4: error: redefinition of 'long long int powmod(long long int, long long int)'
  107 | ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
      |    ^~~~~~
a.cc:10:4: note: 'long long int powmod(long long int, long long int)' previously defined here
   10 | ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
      |    ^~~~~~
a.cc:108:4: error: redefinition of 'long long int gcd(long long int, long long int)'
  108 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
      |    ^~~
a.cc:11:4: note: 'long long int gcd(long long int, long long int)' previously defined here
   11 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
      |    ^~~
a.cc:109:4: error: redefinition of 'long long int lcm(long long int, long long int)'
  109 | ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
      |    ^~~
a.cc:12:4: note: 'long long int lcm(long long int, long long int)' previously defined here
   12 | ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
      |    ^~~
a.cc:110:4: error: redefinition of 'long long int extended_gcd(long long int, long long int, long long int&, long long int&)'
  110 | ll extended_gcd(ll a, ll b, ll &x, ll &y) {
      |    ^~~~~~~~~~~~
a.cc:13:4: note: 'long long int extended_gcd(long long int, long long int, long long int&, long long int&)' previously defined here
   13 | ll extended_gcd(ll a, ll b, ll &x, ll &y) {
      |    ^~~~~~~~~~~~
a.cc:117:10: error: redefinition of 'const long long int sz'
  117 | const ll sz = 1e4 + 5;
      |          ^~
a.cc:20:10: note: 'const long long int sz' previously defined here
   20 | const ll sz = 1e4 + 5;
      |          ^~
a.cc:118:12: error: redefinition of 'std::vector<long long int> fac'
  118 | vector<ll> fac(sz, 1);
      |            ^~~
a.cc:21:12: note: 'std::vector<long long int> fac' previously declared here
   21 | vector<ll> fac(sz, 1);
      |            ^~~
a.cc:129:4: error: redefinition of 'long long int res'
  129 | ll res;
      |    ^~~
a.cc:32:4: note: 'long long int res' previously declared here
   32 | ll res;
      |    ^~~
a.cc:149:5: error: redefinition of 'int main()'
  149 | int main() {
      |     ^~~~
a.cc:52:5: note: 'int main()' previously defined here
   52 | int main() {
      |     ^~~~
a.cc:203:10: error: redefinition of 'const long long int mod'
  203 | const ll mod = 1e9 + 7;
      |          ^~~
a.cc:9:10: note: 'const long long int mod' previously defined here
    9 | const ll mod = 1e9 + 7;
      |          ^~~
a.cc:204:4: error: redefinition of 'long long int powmod(long long int, long long int)'
  204 | ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
      |    ^~~~~~
a.cc:10:4: note: 'long long int powmod(long long int, long long int)' previously defined here
   10 | ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
      |    ^~~~~~
a.cc:205:4: error: redefinition of 'long long int gcd(long long int, long long int)'
  205 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
      |    ^~~
a.cc:11:4: note: 'long long int gcd(long long int, long long int)' previously defined here
   11 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
      |    ^~~
a.cc:206:4: error: redefinition of 'long long int lcm(long long int, long long int)'
  206 | ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
      |    ^~~
a.cc:12:4: note: 'long long int lcm(long long int, long long int)' previously defined here
   12 | ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
      |    ^~~
a.cc:207:4: error: redefinition of 'long long int extended_gcd(long long int, long long int, long long int&, long long int&)'
  207 | ll extended_gcd(ll a, ll b, ll &x, ll &y) {
      |    ^~~~~~~~~~~~
a.cc:13:4: note: 'long long int extended_gcd(long long int, long long int, long long int&, long long int&)' previously defined here
   13 | ll extended_gcd(ll a, ll b, ll &x, ll &y) {
      |    ^~~~~~~~~~~~
a.cc:214:10: error: redefinition of 'const long long int sz'
  214 | const ll sz = 1e4 + 5;
      |          ^~
a.cc:20:10: note: 'const long long int sz' previously defined here
   20 | const ll sz = 1e4 + 5;
      |          ^~
a.cc:215:12: error: redefinition of 'std::vector<long long int> fac'
  215 | vector<ll> fac(sz, 1);
      |            ^~~
a.cc:21:12: note: 'std::vector<long long int> fac' previously declared here
   21 | vector<ll> fac(sz, 1);
      |            ^~~
a.cc:226:4: error: redefinition of 'long long int res'
  226 | ll res;
      |    ^~~
a.cc:32:4: note: 'long long int res' previously declared here
   32 | ll res;
      |    ^~~
a.cc:246:5: error: redefinition of 'int main()'
  246 | int main() {
      |     ^~~~
a.cc:52:5: note: 'int main()' previously defined here
   52 | int main() {
      |     ^~~~
a.cc:300:10: error: redefinition of 'const long long int mod'
  300 | const ll mod = 1e9 + 7;
      |          ^~~
a.cc:9:10: note: 'const long long int mod' previously defined here
    9 | const ll mod = 1e9 + 7;
      |          ^~~
a.cc:301:4: error: redefinition of 'long long int powmod(long long int, long long int)'
  301 | ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
      |    ^~~~~~
a.cc:10:4: note: 'long long int powmod(long long int, long long int)' previously defined here
   10 | ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
      |    ^~~~~~
a.cc:302:4: error: redefinition of 'long long int gcd(long long int, long long int)'
  302 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
      |    ^~~
a.cc:11:4: note: 'long long int gcd(long long int, long long int)' previously defined here
   11 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
      |    ^~~
a.cc:303:4: error: redefinition of 'long long int lcm(long long int, long long int)'
  303 | ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
      |    ^~~
a.cc:12:4: note: 'long long int lcm(long long int, long long int)' previously defined here
   12 | ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
      |    ^~~
a.cc:304:4: error: redefinition of 'long long int extended_gcd(long long int, long long int, long long int&, long long int&)'
  304 | ll extended_gcd(ll a, ll b, ll &x, ll &y) {
      |    ^~~~~~~~~~~~
a.cc:13:4: note: 'long long int extended_gcd(long long int, long long int, long long int&, long long int&)' previously defined here
   13 | ll extended_gcd(ll a, ll b, ll &x, ll &y) {
      |    ^~~~~~~~~~~~
a.cc:311:10: error: redefinition of 'const long long int sz'
  311 | const ll sz = 1e4 + 5;
      |          ^~
a.cc:20:10: note: 'const long long int sz' previously defined here
   20 | const ll sz = 1e4 + 5;
      |          ^~
a.cc:312:12: error: redefinition of 'std::vector<long long int> fac'
  312 | vector<ll> fac(sz, 1);
      |            ^~~
a.cc:21:12: note: 'std::vector<long long int> fac' previously declared here
   21 | vector<ll> fac(sz, 1);
      |            ^~~
a.cc:323:4: error: redefinition of 'long long int res'
  323 | ll res;
      |    ^~~
a.cc:32:4: note: 'long long int res' previously declared here
   32 | ll res;
      |    ^~~
a.cc:343:5: error: redefinition of 'int main()'
  343 | int main() {
      |     ^~~~
a.cc:52:5: note: 'int main()' previously defined here
   52 | int main() {
      |     ^~~~
a.cc:397:10: error: redefinition of 'const long long int mod'
  397 | const ll mod = 1e9 + 7;
      |          ^~~
a.cc:9:10: note: 'const long long int mod' previously defined here
    9 | const ll mod = 1e9 + 7;
      |          ^~~
a.cc:398:4: error: redefinition of 'long long int powmod(long long int, long long int)'
  398 | ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
      |    ^~~~~~
a.cc:10:4: note: 'long long int powmod(long long int, long long int)' previously defined here
   10 | ll powmod(ll a, ll b) { ll res=1; a%=mod; assert(b>=0); for(;b;b>>=1) { if(b&1) res=res*a%mod; a=a*a%mod; } return res; }
      |    ^~~~~~
a.cc:399:4: error: redefinition of 'long long int gcd(long long int, long long int)'
  399 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
      |    ^~~
a.cc:11:4: note: 'long long int gcd(long long int, long long int)' previously defined here
   11 | ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }
      |    ^~~
a.cc:400:4: error: redefinition of 'long long int lcm(long long int, long long int)'
  400 | ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
      |    ^~~
a.cc:12:4: note: 'long long int lcm(long long int, long long int)' previously defined here
   12 | ll lcm(ll a, ll b) { return (a / gcd(a,b)) * b; }
      |    ^~~
a.cc:401:4: error: redefinition of 'long long int extended_gcd(long long int, long long int, long long int&, long long int&)'
  401 | ll extended_gcd(ll a, ll b, ll &x, ll &y) {
      |    ^~~~~~~~~~~~
a.cc:13:4: note: 'long long int extended_gcd(long long int, long long int, long long int&, long long int&)' previously defined here
   13 | ll extended_gcd(ll a, ll b, ll &x, ll &y) {
      |    ^~~~~~~~~~~~
a.cc:408:10: error: redefinition of 'const long long int sz'
  408 | const ll sz = 1e4 + 5;
      |          ^~
a.cc:20:10: note: 'const long long int sz' previously defined here
   20 | const ll sz = 1e4 + 5;
      |          ^~
a.cc:409:12: error: redefinition of 'std::vector<long long int> fac'
  409 | vector<ll> fac(sz, 1);
      |            ^~~
a.cc:21:12: note: 'std::vector<long long int> fac' previously declared here
   21 | vector<ll> fac(sz, 1);
      |            ^~~
a.cc:420:4: error: redefinition of 'long long int res'
  420 | ll res;
      |    ^~~
a.cc:32:4: note: 'long long int res' previously declared here
   32 | ll res;