#include #include #include #include using namespace std; long n,m,c=1e15,d; double N,M; double mypow(double a,long b) { if(b==0)return 1; else { while(a>=10)d+=b,a/=10; double ret=mypow(a*a,b/2)*(b%2?a:1); while(ret>=10)d++,ret/=10; while(ret<1)d--,ret*=10; return ret; } } 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>=i;a+=n/j)j*=i; c=min(c,a/cnt); } } if(m>1) { long a=n/m; for(long j=m;~-n/j+1>=m;a+=n/j)j*=m; c=min(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; cout<