#P3766. 核心密码B

    ID: 2710 远端评测题 3000ms 125MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>数学洛谷原创Special JudgeO2优化优先队列概率论,统计洛谷月赛

核心密码B

Description

Let g(n)g(n) denote the number of different ways nn can be expressed as a perfect kk-th power (k>1k > 1). Compute f(n)=i=2ng(i)if(n)=\sum_{i=2}^n \frac{g(i)}{i}.

For example, 64=26=43=8264=2^6=4^3=8^2, so g(64)=3g(64)=3.

Input Format

Multiple queries. The first line contains an integer TT indicating the number of queries.

Each of the next TT lines contains an integer nn, asking for f(n)f(n).

Output Format

Output TT lines. Each line contains a real number representing f(n)f(n), with fourteen decimal places.

Due to precision error, your answer will be accepted if the absolute difference from the standard answer is within 2×10142 \times 10^{-14}.

2
5
15
0.25000000000000
0.48611111111111

Hint

For 20%20\% of the testdata, n1000n \leq 1000.

For 40%40\% of the testdata, n106n \leq 10^6, T5T \leq 5.

For 100%100\% of the testdata, 2n10182 \leq n \leq 10^{18}, 1T500001 \leq T \leq 50000.

Translated by ChatGPT 5