Company: Flipkart_19july
Difficulty: medium
Total Area Covered by Rectangles Problem Description Consider a graph paper which has N rectangles drawn on it. Co-ordinates of each rectangle's bottom left corner (x1, y1) and top right corner (x2, y2) are given. Write a program to find the total area A covered on the graph paper by all the rectangles together. Read the input from STDIN and print the output to STDOUT. Do not print arbitrary strings anywhere in the program, as these contribute to the standard output and test cases will fail. Input Format First line of input contains N . Next N lines of input contain x1, y1, x2, y2 respectively, each separated by a single white space. Output Format The output contains total area A covered by all the rectangles. Examples Example 1: Input: 2 0 0 20 10 10 4 14 8 Output: 200 Explanation: There are 2 rectangles drawn on the graph paper. First rectangle is drawn with red color and second rectangle is drawn with black colour. Area covered by first rectangle is 20 * 10 = 200. Since the second r