#include #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair P; ll n,m; double ume[1001]={}; int main(void){ scanf("%lld%lld",&n,&m); ll cnt=0; ll np=n; while(np>=m){ cnt+=np/m; np/=m; } long double sum=lgammal(n+1LL); sum/=log(10); long double nex=log10l(m); sum-=(long double)nex*cnt; ll resp=sum; double rest=(long double)sum-resp; printf("%.10fe%lld\n",pow(10,rest),resp); return 0; }