#P1696. Blocked Billboard
Blocked Billboard
Blocked Billboard
Bessie the cow used to enjoy a scenic view from her barn, which included two billboards: one advertising delicious cow feed and the other advertising Farmer Larry's Lawnmowers. Unfortunately, the lawnmower billboard has been updated in a way that displeases Bessie. Luckily, the cow feed billboard is positioned in front of the lawnmower billboard and may cover part of it.
Bessie’s plan is to cover the remaining visible part of the lawnmower billboard with a rectangular tarp (whose sides must remain parallel to the billboards) so that she cannot see any part of it. Note that because the tarp must be rectangular, its area might be slightly larger than the actual uncovered area of the lawnmower billboard.
Given the coordinates of the lawnmower billboard and the cow feed billboard, calculate the minimum area of tarp that Bessie will need.
Note: A billboard is defined by the coordinates of its lower-left and upper-right corners.
inputFormat
The input consists of two lines. The first line contains four integers x1, y1, x2, y2 representing the lower-left and upper-right coordinates of the lawnmower billboard. The second line contains four integers x3, y3, x4, y4 representing the lower-left and upper-right coordinates of the cow feed billboard.
outputFormat
Output a single integer: the minimum area of the tarp required so that no part of the lawnmower billboard remains visible.
sample
2 1 7 4
1 0 8 5
0