Triangle and Circle#3683

Triangle and Circle

1 second
64 megabytes
Very hard

Do you enjoy tackling geometric challenges?

If so, try determining the intersection area between a circle and a triangle on a plane.

Input

The first line provides x_0, y_0, r_0—representing the center coordinates and radius of the circle. The second line lists x_1, y_1, x_2, y_2, x_3, y_3—the coordinates of the triangle's vertices. All input numbers are positive integers and do not exceed .

Output

Output a single number representing the area of the intersection between the circle and the triangle, ensuring an absolute or relative error precision of 10^{-6}.

Examples

Example 1

Loading
Loading