Codeforces Round 308 (Div. 2)
A
Vanya and Table
Codeforces
1000
原题
←B →
翻译中…

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 $100$ from left to right.

翻译中…

In this table, Vanya chose $*n*$ rectangles with sides that go along borders of squares (some rectangles probably occur multiple times). After that for each cell of the table he counted the number of rectangles it belongs to and wrote this number into it. Now he wants to find the sum of values in all cells of the table and as the table is too large, he asks you to help him find the result.

翻译中…

Input

翻译中…

The first line contains integer $*n*$ ($1 ≤ *n* ≤ 100$) — the number of rectangles.

翻译中…

Each of the following $*n*$ lines contains four integers $*x*_{1}, *y*_{1}, *x*_{2}, *y*_{2}$ ($1 ≤ *x*_{1} ≤ *x*_{2} ≤ 100$, $1 ≤ *y*_{1} ≤ *y*_{2} ≤ 100)$, where $*x*_{1}$ and $*y*_{1}$ are the number of the column and row of the lower left cell and $*x*_{2}$ and $*y*_{2}$ are the number of the column and row of the upper right cell of a rectangle.

翻译中…

Output

翻译中…

In a single line print the sum of all values in the cells of the table.

翻译中…

Note

翻译中…

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$.

翻译中…

样例

Input #1
2
1 1 2 3
2 2 3 3
Output #1
10
InputCopy OutputCopy
Input #2
2
1 1 3 3
1 1 3 3
Output #2
18
InputCopy OutputCopy
题目信息
题号
552A
时间限制
2 s
内存限制
256 MB
标签
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。