LearnPy Hub
← Arena
IntermediateRating 1200

Area Covered by Two Rectangles

Two rectangles have sides parallel to the axes, given by their bottom-left and top-right corners. Print the total area they cover together (overlap counted once).

Input

Two lines 'x1 y1 x2 y2'.

Output

One integer.

Sample 1

Input
-3 0 3 4
0 -1 9 2
Output
45

Sample 2

Input
-2 -2 2 2
-2 -2 2 2
Output
16
solution.py
Output appears here
Area Covered by Two Rectangles · Python Arena problem · LearnPy Hub