Evil Geometry

The MindCoding team knows how much everybody (including megeve) hates geometry problems. In fact, the MindCoding team is jealous of megeve's skill beccause he succeeded in programming the competition website in x86 assembly, fixing errors, bugs and warnings, making the site fully operational in just a few hours, so they've decided to give him with a challenging analytical geometry problem. If he manages to solve it, then they would agree that his programming skills are simply peerless.

They didn't know that you've already helped him three times to acomplish his job and they'll never know that you are going to help him this time too. The mindcoding team have searched through all of their math books until one of them found the following problem:

You are given 3 elipses A, B, C on a plane. Find the area of their reunion (the plane region A ∪ B ∪ C). Refer to image 1 and image 2 for clarifications. Please note that each ellipse includes its interior.

They agreed that this is the kind of problem they were looking for and gave it to megeve. He secretly replaced the 1000 points problem of the second round of MindCoding with this problem and also shortened its statement (because he hates long statements).

He did this in order you to be able to help him again by submitting your solution to the online judge. If you solve this problem, megeve will personaly congratulate you.


The input consists of 3 lines, each of them representing the description of an ellipse. Each ellipse is described by four numbers, Cx, Cy, Rx, Ry (the coordinates of the center of the ellipse and the horizontal and vertical radii of the elipse - the major and minor axes are parallel to Ox and Oy). See image 3 image 4 for more information.


The first and only line of the output will contain the total area of the given ellipses.


The answer is a real number, but all the numbers from the input are integers (|Cx| < 50, |Cy| < 50, 0 ≤ Rx < 25, 0 ≤ Ry < 25).

Your answer is considered correct if abs(correct_answer - your_answer) < 0.01


7 3 6 6
10 8 6 6
13 3 6 6
229.646249Please refer to Image 4 for the elipses' configuration in the sample.

Sponsors Gold