#P6307. 「Wdsr-1」贤者之石

「Wdsr-1」贤者之石

Description

Patchouli sets up an equilateral triangular lattice with side length k1k-1 (kk points on each side). On each point, you can and must place exactly one elemental stone.

In the demon world, an equilateral triangle is considered the most beautiful and stable shape. Therefore, if and only if the three elemental stones placed on the lattice form an equilateral triangle, they can be fused into one Philosopher’s Stone.

Patchouli defines that if she randomly selects three points in the lattice of side length k1k-1 and places elemental stones on them, then the probability that these three stones can be fused into a Philosopher’s Stone is called PkP_k. (P1=0,P2=1P_1=0, P_2=1)

Now, to challenge your wisdom, Patchouli wants you to compute

k=m+Pk\sum_{k=m}^{+\infty}P_k

where mm is a given integer.

Input Format

One line containing one integer mm.

Output Format

Output one decimal number on one line, representing the required answer.

You must keep 55 significant digits and use scientific notation.

Examples:

If the answer is 0.0123, you should output 1.2300x10^-2.

If the answer is 1.2345, you should output 1.2345x10^0.

100
2.0003x10^-2
114
1.7546x10^-2
223
8.9689x10^-3

Hint

Constraints

$$\def\arraystretch{1.5}\begin{array}{|c|c|c|}\hline Subtasks & \textbf{ID} & m \\ \hline 1 & [1,15] & \le 100\\\hline 2 & [16,35] & \le 500\\\hline 3 & [36,40] & \le 10^3\\\hline 4 & [41,45] & \le 10^4\\\hline 5 & [46,50] & \le 65535\\\hline \end{array}$$

Here, [l,r][l,r] means the test points with IDs l,l+1,,r1,rl,l+1,\cdots,r-1,r.

  • In addition, it is guaranteed that m1m\ge 1.

Translated by ChatGPT 5