Cylinder
Easy
Execution time limit is 2 seconds
Runtime memory usage limit is 256 megabytes
Consider the doubly infinite cylinder whose axis passes through the center of the Cartesian coordinate system, the radius R. In this problem you need to calculate the surface area of a ball centered at c of radius r, which is contained in the cylinder.
Input
The first line contains four numbers r, x_c, y_c, z_c — radius of the sphere and the coordinates of its center. The second line contains four numbers R, x_v, y_v, z_v — cylinder radius and the coordinates of points on its axis (not the same origin). All numbers are integers, do not exceed the absolute value of 1000, the radii are positive.
Output
Bring out a single number - the surface area of the ball that has fallen into the interior of the cylinder, with an accuracy of less than 4 decimal places.
Examples
Input #1
Answer #1
Submissions 33
Acceptance rate 6%