Editorial for JDCC '16 Contest 2 P5 - Supermoon Viewing
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Considering edge cases gets you of the points. These include: no area and one circle within the other.
The intersection of two circles can be seen as two chords. The area of a chord can be found by subtracting the area of a triangle by the area of the inner isosceles triangle.
To make the problem simpler, translate the two circles onto the -axis. One of which has a center on the origin. To do this, find the distance between the two centers. Now the new centers are and . Then solve for the points of intersection. Now you have all the pieces of information you need to find the areas.
Time Complexity:
Comments