On the Euclidean plane, an ant travels from point to point for an integer .
In each step, the ant at point chooses one of the lattice points which satisfy and and goes straight to at a constant velocity . The value of depends on and as follows:
If , the value of equals .
If , the value of equals .
The left image is one of the possible paths for . First the ant goes from to at velocity . Then the required time is .
From to the ant travels at velocity so the required time is . From to the ant travels at velocity so the required time is .
Thus the total required time is .
The right image is another path. The total required time is calculated as . It can be shown that this is the quickest path for .
Let be the total required time if the ant chooses the quickest path. For example, .
We can verify that and .
Find . Give your answer rounded to nine decimal places.
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.