Two Circles
Time limit1sMemory limit128 MB
Compute the area of the overlapping region of two circles from their centers and radii, printing the result to three decimals.
- Level
Medium4 of 10
- Topics
- Geometry, Math, Implementation
- Solved
- No attempts yet
Problem
Two circles are given on a 2D plane. Write a program that computes the area of the region where the two circles overlap (their intersection), accurate to three decimal places.
Input
The first line contains six real numbers , , , , , , separated by spaces. and are the centers of the first and second circle, and and are their radii. Each real number is given with at most two digits after the decimal point.
Output
On the first line, print the area of the overlapping region, rounded to three decimal places. If the two circles do not overlap, print .