P1884 [USACO12FEB] Overplanting S

Description

Farmer John has purchased a new machine that is capable of planting grass within any rectangular region of his farm that is "axially aligned" (i.e., with vertical and horizontal sides). Unfortunately, the machine malfunctions one day and plants grass in not one, but N (1

Input Format

第一行,一个整数 $N\ (1 \le N \le 1000)$。 接下来有 $N$ 行,每行描述一个矩形的信息,分别是矩形的 $x_1,y_1,x_2,y_2(-10^8 \le x_1,y_1,x_2,y_2 \le 10^8)$。

Output Format

一个整数,被 $N$ 个矩形覆盖的区域的面积。