#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define syosu(x) fixed< P; typedef pair pdd; typedef pair pll; typedef vector vi; typedef vector vvi; typedef vector vd; typedef vector vvd; typedef vector vl; typedef vector vvl; typedef vector vc; typedef vector vvc; typedef vector vs; typedef vector vb; typedef vector vvb; typedef vector

vp; typedef vector vvp; typedef vector vpll; typedef pair pip; typedef vector vip; const int inf=1<<30; const ll INF=1ll<<60; const double pi=acos(-1); const double eps=1e-8; const ll mod=1e9+7; const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0}; const double H=1.0/2; const double ten=log(10); ll n,m; ll f(ll x){ ll X=1,res=0; do{ X*=x; res+=n/X; }while(X>n>>m; double N=n,x=N*log(N)-N+H*log(2*pi*N)+1.0/12/N-1.0/360/N/N/N; x/=ten; ll M=INF,m_=m; for(ll i=2;i*i<=m_;i++) if(m_%i==0){ ll num=0; while(m_%i==0){ m_/=i; num++; } M=min(M,f(i)/num); } if(m_!=1) M=min(M,f(m_)); if(M!=INF) x-=(double)M*log(m)/ten; ll d=(ll)(x+eps); x-=d; vector a(100000); a[0]={inf,0}; for(int i=1;i<100000;i++){ double tmp=(double)i/10000; a[i]={fabs(log(tmp)/ten-x),tmp}; } sort(a.begin(),a.end()); cout<