SP17123 IMBOX - Destroying the Weapon Warehouse
Description
Iron man is hovering over enemy territories. He comes across their weapons warehouse. The weapons are stored in **N** rectangular boxes. No two boxes share edges. Boxes may be located inside other boxes but no two boxes will partially overlap each other. Iron man can destroy a box by sending a magnetic pulse with power equal to area of the box (irrespective of the height of the box). This pulse will destroy anything present inside the box. Since Iron man is running low on power, he conveys the 2-D coordinates of all the boxes (as seen from the top view) to Jarvis(artificial intelligence) to calculate the minimum total power of the pulses that will be used to destroy all the boxes. Help Jarvis in determining the total effective area of the weapon warehouse to which the beam needs to be directed to destroy all the boxes.
Input Format
The first line of the input contains an integer **N** denoting the number of rectangular boxes. **N** lines follow. Each following line contains 4 integers- **x\_1, y\_1, x\_2, y\_2** where coordinates **(x\_1,y\_1)** and **(x\_2,y\_2)** uniquely identify a rectangular box.
- **1** N 10 $ ^{5} $
- **-10 $ ^{8} $** x\_1, y\_1, x\_2, y\_2 10 $ ^{8} $
Output Format
Print the total effective area to be destroyed.