#P6028. 算术

算术

Description

As everyone knows, when Gauss was in elementary school, one day his math teacher gave a problem: 1+2++100=?1+2+\cdots+100=?. He thought the students would take a long time to add 100100 numbers, so he planned to slip away for coffee. But at that moment, Gauss raised his hand and said he was done—he used the arithmetic progression sum formula that we all know today.

However, the arithmetic teacher in this class is just as irresponsible as Gauss’s teacher. After leaving an arithmetic problem on the blackboard, he ran off to flirt. But Little W is not as smart as Gauss, and this expression does not seem to have any clever trick. So he called you, who study OI\text{OI}, hoping you can help him. In return, he will give you 100100 points as a reward.

Specifically, the expression on the blackboard is:

Let the prime factorization of nn be n=i=1kpiαin=\prod\limits_{i=1}^kp_i^{\alpha_i}. Define $f(n)=\prod\limits_{i=1}^k{\dfrac{p_i^{\alpha_i+1}-1}{p_i^{\alpha_i+1}-p_i^{\alpha_i}}}$. Find the value of i=1nf(i)\sum\limits_{i=1}^nf(i) (see the Hint and Notes for precision requirements).

Note: In particular, we define f(1)=1f(1)=1.

Input Format

One line with an integer nn, as described above.

Output Format

One line with a real number representing the result.

2

2.5000000000
5
6.7833333333

Hint

Explanation of Sample 2: $f(1)=1,f(2)=\dfrac{2^2-1}{2^2-2^1}=1.5,f(3)=\dfrac{3^2-1}{3^2-3^1}=1.3333333333,f(4)=\dfrac{2^3-1}{2^3-2^2}=1.75,f(5)=\dfrac{5^2-1}{5^2-5^1}=1.2$.


This problem uses SPJ\text{SPJ}. Let your answer be aa, and the standard answer be bb.
If abmin(b104,10) |{a-b}|\le \min(\dfrac b{10^4},10) , you will get full score for this test point;
otherwise, if abmin(b103,100)|{a-b}|\le \min(\dfrac b{10^3},100), you will get 40%40\% of the score for this test point;
otherwise, you will get no score.
The standard answer will keep 10 digits after the decimal point.
Note: Although the precision requirement is not strict, it is still recommended to use more accurate long double to store the answer.


Constraints:
For 10%10\% of the testdata, n10n\le10.
For 30%30\% of the testdata, n103n\le10^3.
For 60%60\% of the testdata, n107n\le10^7.
For 100%100\% of the testdata, 1n10131\le n\le10^{13}.

Translated by ChatGPT 5