| Winter Cup 5.0 Online Mirror Contest |
|---|
| Finished |
Rami was playing with the following algorithm. He chooses a positive integer $$$n\in\mathbb{N}^*$$$
He begins with $$$R= 1$$$ and $$$k=0$$$ and while $$$R\bmod n\ne 0,$$$ he:
As $$$k$$$ denotes the number of iterations on the loop, he wants to know the expected value of $$$k$$$.
For each test case, output a single real $$$k:$$$ the expected runtime of the algorithm.
Your answer is considered correct if its absolute or relative error does not exceed $$$10^{-6}$$$.
Formally, let your answer be $$$a$$$, and the jury's answer be $$$b$$$. Your answer is accepted if and only if $$$\frac{|a-b|}{max(1,|b|)} \le 10^{-6}$$$.
6 2 3 10 25 100 1024
2.000000 3.000000 5.333333 9.000000 9.296296 11.000000
| Name |
|---|


