#P7651. [BalticOI 1996] A SQUARE AND A CIRCLE (Day 1)
[BalticOI 1996] A SQUARE AND A CIRCLE (Day 1)
Description
On a plane, there is a square and a circle. Given the coordinates of two opposite vertices of the square, and the center coordinates and radius of the circle, find the area common to the square and the circle.
Input Format
The first two lines contain the coordinates of two opposite vertices of the square and . The third line contains the circle center coordinates and the radius , all of which are real numbers.
Output Format
Output the common area of the two shapes, to two digits after the decimal point.
0 5.0
10.00 -5
3.0 1 4.00
46.64
Hint
Constraints
For of the testdata, , .
Scoring
The score for this problem follows the original BOI settings, with a full score of .
Notes
This problem comes from Day 1:A SQUARE AND A CIRCLE of the Baltic Olympiad in Informatics 1996.
Translated and organized by @求学的企鹅.
Translated by ChatGPT 5
京公网安备 11011102002149号