At your neighbourhood Halloween party, appropriately named
The Ninth Triangle of the Underworld, you've decided to play a fun game! Two witch hats are placed on conveyor belts moving in opposite directions. For simplicity, we can imagine the witch hats as triangles, with their bases on the same line parallel to the -axis, and that the witch hats will continue moving in opposite directions for eternity.
You are asked to throw a ball at the witch hats and will win a prize if you hit either one of them. To make your life more difficult, you will only be told the side lengths of the triangles and will not be told the orientation of the witch hats. In addition, you will not be told when to throw the ball at the targets.
You want to know what is the smallest target area you could possibly be facing when you throw the ball. The target area is the area of the union of the two triangles at their current locations.
The first line of input contains integers, , the side lengths of the first triangle representing the first witch hat.
The second line of input contains integers, , the side lengths of the second triangle representing the second witch hat.
This problem is graded with an custom checker.
Output, on a single line, the smallest target area you could possibly be facing when you throw the ball at the witch hats. Ensure this line is terminated with a
\n character and has no leading nor trailing spaces.
Your answer will be considered correct if it has an absolute or relative error of at most from the reference solution. It is guaranteed that the absolute or relative error of the reference solution is much smaller than from the optimal solution.
8 5 5 6 6 6