#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair P; const double PI=acos(-1.0); int main() { ll n, m; cin>>n>>m; vector

v; ll m1=m; for(ll i=2; i*i<=m1; i++){ if(m1%i==0){ ll e=0; while(m1%i==0){ e++; m1/=i; } v.push_back({i, e}); } } if(m1>1) v.push_back({m1, 1}); ll k=1e12; for(auto q:v){ ll p=q.first, e=q.second; ll c=0, n1=n/p; while(n1){ c+=n1; n1/=p; } k=min(k, c/e); } double ans=-k*log10((double)m); if(n>1e6) ans+=1/log(10.0)*(n*log((double)n)-n+0.5*log(2*PI*n)); else{ for(int i=1; i<=n; i++) ans+=log10((double)i); } ll d=(ll)ans; double p=pow(10.0, ans-d); printf("%.3lfe%lld", p, d); return 0; }