OCC '19 S1 - Floor Planning

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Problem type

Angie is buying a house!

The floor plan of the house can be represented as two rectangles on the Cartesian plane: one from (x_1, y_1) to (x_2, y_2) and one from (x_3, y_3) to (x_4, y_4).

She wants to know how large her house is. Can you help her find out?


1 \le x_1, x_2, x_3, x_4, y_1, y_2, y_3, y_4 \le 10^3

Input Specification

The first line contains the space separated integers x_1,y_1,x_2,y_2 (the coordinates of the first rectangle).

The second line contains the space separated integers x_3,y_3,x_4,y_4 (the coordinates of the second rectangle).

Output Specification

Output one integer, the total area of the floor plan.

Sample Input

2 6 11 10
14 14 8 5

Sample Output



There are no comments at the moment.