package main import . "fmt" var memo =map[int]float64{} func f(n int) float64 { if n==0 { return 0 } if n==1 { return 1 } if z,ok:=memo[n]; ok{ return z } var t float64 for x:=0;x<=n-1;x++ { c1:=f(x) c2:=f(n-x-1) t+=(c1+c2+1)/float64(n) } memo[n]=t return t } func main() { var n int Scan(&n) Printf("%.10f\n", f(n)) }