Time Limit: 2000MS |
| Memory Limit: 262144KB |
| 64bit IO Format: %I64d & %I64u |
CodeForces - 552A Vanya and Table Submit Status Description Vanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom to top, the columns are numbered from 1 to 100from left to right. In this table, Vanya chose n Input The first line contains integer n (1 ≤ n ≤ 100) — the number of rectangles. Each of the following n lines contains four integers x1, y1, x2, y2 (1 ≤ x1 ≤ x2 ≤ 100, 1 ≤ y1 ≤ y2 ≤ 100), where x1 and y1 are the number of the column and row of the lower left cell and x2 and y2 Output In a single line print the sum of all values in the cells of the table. Sample Input Input 21 1 2 32 2 3 3 Output 10 Input 21 1 3 31 1 3 3 Output 18 Hint Note to the first sample test: Values of the table in the first three rows and columns will be as follows: 121 121 110 So, the sum of values will be equal to 10. Note to the second sample test: Values of the table in the first three rows and columns will be as follows: 222 222 222 So, the sum of values will be equal to 18. Source Codeforces Round #308 (Div. 2) //题意:输入一个n,接下来输入n个(x1,y1)(x2,y2). 表示给你n个矩形的左下(横纵坐标都加了1,计算时减去即可)和右上的坐标,让你计算这n个矩形的面积。
|