eolymp
bolt
Try our new interface for solving problems

LOGO

\includegraphics{https://static.e-olymp.com/content/32/3224969ea91b916391eec4ccdf99dcd4def683c0.jpg} Company VENICE ordered you a new logo for its products - the modern PC, which the company produces the best parts, and it is selected on world markets. The company wants to have a background logo looks like two squares that overlap. Sami squares must be black, and their intersection - white. One of the options for the background logo, you can see in the picture. You need to find the area of the black parts of the logo. \textbf{Note}: The squares in the logo may intersect in an arbitrary manner, in particular, they can be nested within each other or touch each other. \InputFile The input data consist of two lines. Each line contains four real numbers: \textbf{x_1}, \textbf{y_1}, \textbf{x_2}, \textbf{y_2} -- coordinates of two opposite vertices of a square. In this \textbf{--1000.0} < \textbf{x_1}, \textbf{y_1}, \textbf{x_2}, \textbf{y_2} < \textbf{1000.0}. \OutputFile Single number - the area of shapes that you want to paint, with an absolute or relative accuracy of \textbf{10^\{--5\}}.
Time limit 1 second
Memory limit 256 MiB
Input example #1
0.0 1.0 3.0 4.0
2.0 3.0 4.0 5.0
Output example #1
11.0
Author A. Khodskiy
Source ACM, Ukraine, First Stage, 09.04.2011