Castiel is a farmer in Heaven. He has an infinite rectangular field (in the form of 2-D grid).Lucifer as a demon wants to attack on Castiel’s field. But Castiel wants to save some part of his field so he harvest N rectangular regions from the field. Help Castiel to determine total area harvested by him.
Note :
1. Two rectangular regions may overlap.
2. Each rectangular region is represented by (x1,y1) and (x2,y2) where (x1,y1) is lower left cell and (x2,y2) is upper right cell of rectangle.(Both inclusive).
3. Sides of rectangular region must be parallel to x and y axis.
Constraint
1 <= N <= 10
1 <= x1 < x2 <= 500
1 <= y1 < y2 <= 500
Problem Setter: Shiv Dhingra