P1050 Union of Rectangles
描述
A rectangle in a plane having its sides parallel to the coordinate axis, is determined by the coordinates of then leftdown and righttop vertex.
Write a program for computing the area of the union of a given sequence of rectangles A_1,A_2,...,A_N.
Example:
A_1 is given by [1;1],[4;3] A_2 is given by [0;1],[6;2] A_3 is given by [2;1],[3;3] A_4 is given by [7;7],[9;9] The area of the union is 13.
输入
第一行输入矩形的个数,以后每行输入左下角和右顶点的坐标,用空格分隔。
输出
输出所有矩形的并集的面积。
样例输入
样例输出