https://www.luogu.com.cn/problem/P4550
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
double num[N],ans[N];
int main()
{
int n;
cin>>n;
num[n]=0;
ans[n]=0;
for(int i=n-1;i>=0;i--)
{
double p1=(double)i/n,p2=(double)(n-i)/n;
// cout<<i<<" "<<n<<" "<<p1<<" "<<p2<<endl;
num[i]=(p2*num[i+1]+1)/(1-p1);
ans[i]=(ans[i+1]*p2+num[i]*p1+num[i+1]*p2+1)/(1-p1);
}
printf("%.2lf",ans[0]);
}