#P10321. 奉献(Dedication)
奉献(Dedication)
Background
A mathematical spirit of constantly pushing yourself forward — dedication.
"Light of Dedication" Lisa is both a priest of "God of Order" Paila and a believer of "God of Disorder" Dionysus.
Lisa recently studied high-precision division. She can compute division of an -digit integer in time complexity.
Problem Description
Lisa wants to make a division table for positive integers up to . Specifically, it is a table that records (, and are both integers). She makes it using the following method:
Enumerate positions in increasing order with as the primary key and as the secondary key. If position is not filled, then:
Compute . The mana cost for this is (where is the number of decimal digits of , i.e., ). Then enumerate positive integers , and for all not filled positions (), fill them with . Each fill costs mana .
Since Mena has already made a multiplication table, Lisa can compute multiplication directly without any mana cost. Now Lisa wants to know how much mana is needed to make the entire division table.
To avoid precision issues, your output is considered correct as long as its relative error from the standard output does not exceed . It is guaranteed that the relative error between the standard output and the actual answer does not exceed .
Input Format
One line with a positive integer , indicating that you want to make a division table of size .
Output Format
One line with a real number, representing the answer.
6
21.0000000
20
422.0000000
233
99838.0384544
Hint
[Sample Explanation]
Since , , so . That is, within this range only filling numbers costs mana. Also, each is at most , so , and each fill costs a fixed mana point. Filling all numbers costs mana.
Therefore, the answer is .
[Constraints]
This problem uses bundled testdata.
Subtask 1 (15 pts): ;
Subtask 2 (15 pts): ;
Subtask 3 (30 pts): ;
Subtask 4 (40 pts): no special constraints.
For all testdata, .
[Hint]
is read as “the logarithm of with base ”. Let , which means .
Translated by ChatGPT 5