spoj#AREA1. Circle vs Triangle
Circle vs Triangle
You are given a triangle and a circle in a plane. You can arbitrarily rotate or move them. What's the maximum possible area of their overlapping region?
Input
Input consists of one or more lines. For each line, there are four integers describing one test case: the lengths of three sides of a triangle a, b, c; and the radius of a circle r; where 1<= a <= b <= c <= 100, 1<= r <= 100, a+b>c .
End of input is indicated by a line consisting four zeros.
Output
For each test case, output a single line showing the largest overlapping area of the circle and the triangle. We accept solutions with absolute error less than 10-2.
Example
Input: 3 4 5 1 5 5 8 4 0 0 0 0</p>Output: 3.14 12.00
Judge is modified on Feb 23,2010. Now you can click on "Wrong Answer" for further information.