Expected Number of Random Moves II

Problem #103

Tags: puzzle statistics difficult

Who solved this?

Previous:Expected Number of Random Moves Next:The Magic Orchard



In the previous problem, we observed number lines with lengths up to 1e7 spaces. If each space on that number line was 1 inch (2.54 cm) long, then a number line with 1e7 spaces would be over 157 miles (25000 km) long!

Problem Statement

Input data
Gives the number of testcases T in the first line.
T lines will follow, each consisting of a single integer n represented in scientific notation.

Answer
Should contain T space-separated decimal values corresponding to the expected values of turns required to reach the end of a number line of length n.
Error should be less than 1e-6.

Example

input data:
2
1.234e10
9.876e100

answer:
23.813328 233.125833
You need to login to get test data and submit solution.