#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n; if(n==0) std::cout << 1 << '\n'; else if(n>=P) std::cout << 0 << '\n'; else{ ll ret = t[(n / 100000000)]; ll st = (n/100000000) * 100000000; for(ll i=st+1;i<=n;i++){ ret = (ret * i)%P; } std::cout << ret << '\n'; } }