Problem C
The Worm in the Apple
Willy the Worm was living happily in an apple – until some vile human picked the apple, and started to eat it! Now, Willy must escape!
Given a description of the apple (defined as a convex shape in 3D space), and a list of possible positions in the apple for Willy (defined as 3D points), determine the minimum distance Willy must travel to get to the surface of the apple from each point.
Input
There will be a single test case in the input. This test
case will begin with a line with a single integer
On the next
Following the description of the apple, there will be a line
with a single integer
Output
For each query, output a single floating point number,
indicating the minimum distance Willy must travel to exit the
apple. The absolute error of your answer should be less than
Sample Input 1 | Sample Output 1 |
---|---|
6 0 0 0 100 0 0 0 100 0 0 0 100 20 20 20 30 20 10 4 1 1 1 30 30 35 7 8 9 90 2 2 |
1.0 2.88675134594812 7.0 2.0 |