Rectangles intersection#2592

Rectangles intersection

1 segundo
128 megabytes
Muy fácil

Two rectangles are given by the integer coordinates of a pair of diagonal vertices in a rectangular coordinate system. The sides of the rectangles are parallel to the axes. Find the area of the common part of the rectangles.

Entrada

Four pairs of integers are given. Each integer does not exceed 10^6 in absolute value.

Salida

Print the area of the common part of the rectangles.

Ejemplos

Ejemplo 1

Loading
Loading