不多提。
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=100000+100;
int n,m;
double dp[MAXN];
int main()
{while(~scanf("%d%d",&n,&m)){double ans=1.0;dp[1]=1.0;for(int i=2;i<=m;i++){dp[i]=(1-dp[i-1])*dp[i-1]+dp[i-1]*(dp[i-1]-1.0/n);ans+=dp[i];}printf("%.10lf\n",ans);}return 0;
}