#P10321. Lisa’s Magic Division Table
Lisa’s Magic Division Table
Lisa’s Magic Division Table
Lisa wants to create a division table for all positive integers up to \(n\). The table is defined only for pairs \((a, b)\) satisfying \(1 \leq b \leq a \leq n\) and records \(\lfloor a/b \rfloor\) at position \((a,b)\). She fills the table in the following way:
List all positions \((a,b)\) in increasing order first by \(a\) and then by \(b\). When reaching a position that has not yet been filled, compute \(\lfloor a/b \rfloor\). This computation costs \(d_a \cdot \log_2 d_a\) magic, where \(d_a\) is the number of digits of \(a\) in decimal, i.e. \(d_a = \lfloor 1+ \log_{10}{a} \rfloor\). Then, for every positive integer \(i\) such that \(a \cdot i \le n\), if the position \((a\cdot i, b\cdot i)\) is still unfilled, she fills it with \(\lfloor a/b \rfloor\) at an additional cost of \(d_i\) magic (where \(d_i = \lfloor 1 + \log_{10}{i} \rfloor\)).
Note that once a position is filled, it will not be processed again. Since Lisa already has a multiplication table, she can calculate products for free. Your task is to compute the total amount of magic required to fill the entire division table.
The answer is accepted as correct if its relative error does not exceed \(10^{-6}\). It is guaranteed that the relative error between the standard answer and the actual answer is at most \(10^{-10}\).
inputFormat
The input consists of a single integer \(n\) (\(1 \le n\)).
outputFormat
Output the total magic consumed when filling the entire division table. Answers with a relative error of at most \(10^{-6}\) are accepted.
sample
1
0