Zeroing Fire
Time limit1sMemory limit512 MB
Given a center circle of radius R and two distinct shot points, find the area of all positions for a third shot whose circumcenter lies inside the center circle.
- Level
Medium7 of 10
- Topics
- Geometry, Math, Linked list, Implementation
- Solved
- No attempts yet
Problem
Doju, who has gone to the Nonsan training center, is receiving zeroing fire training. In this training, the soldier fires three shots at a target with a circle drawn at its center, and passes if the circumcenter of the three bullet holes (the center of the circle passing through all three points) lies inside the center circle. A point lying exactly on the circumference is also allowed, and if the three points fail to form a triangle, the soldier fails. It is a hard standard to understand, but training centers have always been like that.
Doju has already fired two shots. Find the area of the region that the remaining shot must hit in order to pass the training.
For convenience, treat the target as a coordinate plane whose origin is the center of the circle, and assume that the bullet never leaves the target because the target is infinite in size.
Input
The first line gives an integer , the radius of the circle drawn at the center of the target, and four integers , the positions of the two bullet holes already fired, separated by spaces. The two points are guaranteed to be distinct.
Output
On the first line, print the area of the region that the third bullet must hit. An answer within an absolute or relative error of or less is accepted.
Hint

These are examples of cases that pass and fail the training in the first sample. The red point is the position of the third bullet hole, and the blue point is the circumcenter of the three points.