Score : $400$ points
We have a graph with $N$ vertices called Vertex $1$ through $N$. Takahashi is standing on Vertex $1$.
The graph has no edges now.
Takahashi will repeatedly do the following operation:
Find the expected value of the number of times he does the operation until the graph becomes connected.
Input is given from Standard Input in the following format:
$N$
Print the answer.
Your answer will be considered correct when its absolute or relative error from our answer is at most $10^{-6}$.
2
2.00000000000
The graph becomes connected when the operation chooses Vertex $2$ for the first time.
By considering the case Vertex $2$ is chosen for the first time in the $i$-th operation for each $i$, the answer is $\sum_{i = 1}^{\infty} (i \times (\frac{1}{2})^i) = 2$.
3
4.50000000000