Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define task "GACANDY"
- #include <iostream>
- #include <cstdio>
- using namespace std;
- using ll = long long;
- using ld = long double;
- constexpr int N = 1e5 + 5;
- constexpr ll mod = 25012003;
- ll n;
- void Read()
- {
- cin >> n;
- }
- ll Pow(ll a, ll b)
- {
- ll ans(1);
- for (; b; b >>= 1)
- {
- if (b & 1)
- ans = ans * a % mod;
- a = a * a % mod;
- }
- return ans;
- }
- void Solve()
- {
- ll gt(1);
- for (int i = 1; i < 25012003; ++i)
- gt = gt * i % mod;
- gt = Pow(gt, n / mod);
- n %= mod;
- for (int i = 1; i <= n; ++i)
- gt = gt * i % mod;
- cout << gt;
- }
- int32_t main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- if (fopen(task ".INP", "r"))
- {
- freopen(task ".INP", "r", stdin);
- freopen(task ".OUT", "w", stdout);
- }
- Read();
- Solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement