ZOJ Problem Set - 3058
Given a circle and a ring, your task is to calculate the area of their intersection.
This problem contains multiple test cases, process to the end of file.
For each case, there are two lines. The first line contains three real numbers x', y' and r' (0 <= r' <= 1024) representing the circle. The second line contains four real numbers x, y, r and R (0 <= r <= R <= 1024) representing the ring.
For each case, output the area with the accuracy of three digits after decimal point in a signal line.
Never output "-0.000"!
10 0 20 -10 0 10 20 20 30 15 40 30 0 30
Author: WU, Zejun
Source: ZOJ Monthly, November 2008