Two rectangles#153

Two rectangles

1 second
64 megabytes
Easy

Input

Given two rectangles on a plane. Each rectangle is defined by the coordinates of the endpoints of one of its diagonals. The sides of the rectangles are parallel to the coordinate axes.

The first line contains four real numbers: X_1, Y_1, X_2, Y_2 — the coordinates of the endpoints of the diagonal of the first rectangle.

The second line contains four real numbers: X_3, Y_3, X_4, Y_4 — the coordinates of the endpoints of the diagonal of the second rectangle.

All coordinates are real numbers, and their absolute values do not exceed 2 \cdot 10^9.

Output

Print a single number — the area of the intersection of the two rectangles, rounded to three decimal places.

Examples

Example 1

Loading
Loading