LearnPy Hub
← Arena
IntermediateRating 1100

Overlapping Rectangles

Two axis-aligned rectangles are given as x1 y1 x2 y2 (bottom-left, top-right). Print the area of their overlap (0 if none).

Input

Two lines.

Output

An area.

Sample 1

Input
0 0 2 2
1 1 3 3
Output
1

Sample 2

Input
0 0 1 1
1 0 2 1
Output
0
solution.py
Output appears here
Overlapping Rectangles · Python Arena problem · LearnPy Hub