AREA1 - Circle vs Triangle

no tags 

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

Output:
3.14
12.00
Judge is modified on Feb 23,2010. Now you can click on "Wrong Answer" for further information.

hide comments
kayfunk: 2013-05-12 21:27:29

i think my logic is right. but i am getting WA can u help me out. my code id @
9249782

Prashant Gupta: 2012-06-10 11:12:59

can u please give a little hint
in this question!!


Added by:Fudan University Problem Setters
Date:2009-05-23
Time limit:3s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: C99 ERL JS-RHINO NODEJS OBJC PERL6 SQLITE VB.NET
Resource:Fudan University Local Contest #1