#include<bits/stdc++.h> usingnamespace std; typedefdouble dnt; template <classT> inlinevoidread(T &x){ x = 0; int c = getchar(), f = 1; for (; !isdigit(c); c = getchar()) if (c == 45) f = -1; for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0'); } int n; dnt m, ans; dnt p[205], f[205][2]; intmain(){ read(n), read(m); m = 1.0/m, p[1] = 1, f[1][1] = 1; for (int i = 2; i <= n; i++) p[i] = p[i-1]*m; for (int i = 2; i <= n; i++) for (int j = 1; j < i; j++) f[i][0] += f[i-j][0]*p[j]*j*(1-2*m), f[i][0] += f[i-j][1]*p[j]*j*(1-m), f[i][1] += f[i-j][0]*p[j]*j*m; for (int i = 1; i < n; i++) ans += f[n-i+1][0]*p[i]*i*i; ans += p[n]*n; returnprintf("%.5lf\n", ans), 0; }