CF1358C.Celex Update
普及/提高-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
During the quarantine, Sicromoft has more free time to create the new functions in "Celex-2021". The developers made a new function GAZ-GIZ, which infinitely fills an infinite table to the right and down from the upper left corner as follows:

The cell with coordinates (x,y) is at the intersection of x-th row and y-th column. Upper left cell (1,1) contains an integer 1.
The developers of the SUM function don't sleep either. Because of the boredom, they teamed up with the developers of the RAND function, so they added the ability to calculate the sum on an arbitrary path from one cell to another, moving down or right. Formally, from the cell (x,y) in one step you can move to the cell (x+1,y) or (x,y+1).
After another Dinwows update, Levian started to study "Celex-2021" (because he wants to be an accountant!). After filling in the table with the GAZ-GIZ function, he asked you to calculate the quantity of possible different amounts on the path from a given cell (x1,y1) to another given cell (x2,y2), if you can only move one cell down or right.
Formally, consider all the paths from the cell (x1,y1) to cell (x2,y2) such that each next cell in the path is located either to the down or to the right of the previous one. Calculate the number of different sums of elements for all such paths.
隔离期间,Sicromoft 公司有更多空闲时间来为“Celex-2021”开发新功能。开发者们创建了一个新函数 GAZ-GIZ,该函数从左上角开始,向右和向下无限地填充一张无限大的表格,填充方式如下:

坐标为 (x,y) 的格子位于第 x 行与第 y 列的交点处。左上角格子 (1,1) 中填入整数 1。
SUM 函数的开发者们也毫不懈怠。由于百无聊赖,他们与 RAND 函数的开发者联手,为系统增加了计算任意路径上元素之和的功能——路径从某一格子出发,终点为另一格子,且每一步只能向下或向右移动。形式化地说,从格子 (x,y) 出发,一步之内只能到达格子 (x+1,y) 或 (x,y+1)。
在又一次 Dinwows 系统更新后,Levian 开始学习“Celex-2021”(因为他立志成为一名会计师!)。在使用 GAZ-GIZ 函数填满表格后,他请你计算:从给定起始格子 (x1,y1) 到给定目标格子 (x2,y2) 的所有路径中(每步只能向下或向右移动一格),路径上所经过格子内数值之和共有多少种不同的取值。
形式化地,考虑所有从格子 (x1,y1) 到格子 (x2,y2) 的路径,其中路径中每个后续格子均位于前一个格子的正下方或正右方。请计算所有此类路径所对应的格子数值之和中,互不相同的和的个数。
输入格式
The first line contains one integer t (1≤t≤57179) — the number of test cases.
Each of the following t lines contains four natural numbers x1, y1, x2, y2 (1≤x1≤x2≤109, 1≤y1≤y2≤109) — coordinates of the start and the end cells.
第一行包含一个整数 t(1≤t≤57179)—— 测试用例的数量。
接下来的 t 行中,每行包含四个自然数 x1、y1、x2、y2(1≤x1≤x2≤109,1≤y1≤y2≤109)—— 起始格子与结束格子的坐标。
输出格式
For each test case, in a separate line, print the number of possible different sums on the way from the start cell to the end cell.
对于每个测试用例,在单独的一行中输出从起始单元格到结束单元格的路径上可能产生的不同和的数量。
输入输出样例
输入#1
4 1 1 2 2 1 2 2 4 179 1 179 100000 5 7 5 7
输出#1
2 3 1 1
说明/提示
In the first test case there are two possible sums: 1+2+5=8 and 1+3+5=9. 
在第一个测试用例中,存在两种可能的和:1+2+5=8 和 1+3+5=9。 
输入解题思路,AI测评打分。不知道怎么写?