Editorial
Let be the expected remaining time when the current value is . We have .
For , the value decreases only when the chosen integer is a divisor of . If is the number of positive divisors of , then there are valid choices among .
Writing the expectation after one choice gives
As ranges over the divisors of that are at least , ranges over every proper divisor of exactly once. Rearranging yields
Only values with appear on the right-hand side, so we may compute the values in increasing order of .
Let be the maximum input value over all test cases. We can preprocess all answers in . Store in the sum of over proper divisors of , and in the number of proper divisors. Immediately after computing , add and to the corresponding arrays for every multiple . The total number of such updates is
For each test case, print the precomputed value rounded to two digits after the decimal point.
Solution written by GPT5.6