#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int llint; typedef long double lldo; #define mp make_pair #define mt make_tuple #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define fir first #define sec second #define res resize #define ins insert #define era erase #define dme cout<<-1<void mineq(T& a,U b){if(a>b){a=b;}} template void maxeq(T& a,U b){if(a>m; lldo ans=1; for(llint i=1;i<=n;i++){ llint it=i; while((it%m)==0){it/=m;} ans*=it; } llint zyo=0; while(ans>=10){zyo++;ans/=10;} cout<>n; if(n<100){small(n);return 0;} ans=(n+1.0/2)*log(n)-n+log(2*pai)/2; llint ni=n,gen; llint m;cin>>m; lldo lod=log((lldo)m); llint da=0; while(ni>0){ ni/=m; da+=ni; } ans-=lod*da; ans*=log10(ena); llint sei=ans; cout<