#include #include #include #include using namespace std; long n,m,c,d; double N,M; double mypow(double a,long b) { if(b==0)return 1; else { while(a>=10)d+=b,a/=10; a=mypow(a*a,b/2)*(b%2?a:1); while(a>=10)d++,a/=10; return a; } } main() { cin>>n>>m;N=n,M=m; for(long i=2;i*i<=m;i++) { if(m%i==0) { long cnt=0,a=n/i; while(m%i==0)m/=i,cnt++; for(long j=i;~-n/j+1>=j;a+=n/j)j*=j; c=max(c,a/cnt); } } if(m>1) { long a=n/m; for(long j=m;~-n/j+1>=j;a+=n/j)j*=j; c=max(c,a); } N++; double ori=(N+1/(12*N-1/(10*N)))/M_E; double f=sqrtl(2*M_PI/N)*mypow(ori,N); for(long i=0;i=10)d++,f/=10; while(f<1)d--,f*=10; cout<