Two rectangles
On a plane, you are given two rectangles, each defined by the coordinates of the endpoints of one of their diagonals. The sides of these rectangles are parallel to the coordinate axes. Your task is to find the area of the overlapping region of these two rectangles.
Input
The first line contains four real numbers: X[1]
, Y[1]
, X[2]
, Y[2]
, which represent the coordinates of the endpoints of the diagonal of the first rectangle. The second line contains four more real numbers: X[3]
, Y[3]
, X[4]
, Y[4]
, representing the endpoints of the diagonal of the second rectangle. All coordinates are real numbers, with absolute values not exceeding 2*10^9
.
Output
Output a single number, which is the area of the overlapping region of the two rectangles, rounded to three decimal places.