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:

 [Image]  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 $(x_1, y_1)$ to another given cell $(x_2, y_2$), if you can only move one cell down or right.

Formally, consider all the paths from the cell $(x_1, y_1)$ to cell $(x_2, y_2)$ 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.


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 57179$) — the number of test cases.

Each of the following $t$ lines contains four natural numbers $x_1$, $y_1$, $x_2$, $y_2$ ($1 \le x_1 \le x_2 \le 10^9$, $1 \le y_1 \le y_2 \le 10^9$) — coordinates of the start and the end cells. 


-----Output-----

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.


-----Example-----
Input
4
1 1 2 2
1 2 2 4
179 1 179 100000
5 7 5 7

Output
2
3
1
1



-----Note-----

In the first test case there are two possible sums: $1+2+5=8$ and $1+3+5=9$. [Image]

Difficulty: MEDIUM_HARD

Solutions:
from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		(x1, y1, x2, y2) = map(int, input().split())
		print((x2 - x1) * (y2 - y1) + 1)
	q = int(input())
	for _ in range(q):
		solve()
main()


for j in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	print((c - a) * (d - b) + 1)


import sys
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def read():
	tc = 0
	if tc:
		input = sys.stdin.readline
	else:
		sys.stdin = open('input1.txt', 'r')
		sys.stdout = open('output1.txt', 'w')

def solve():
	for _ in range(ii()):
		(x1, y1, x2, y2) = mi()
		print((x2 - x1) * (y2 - y1) + 1)
solve()


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	x = (c - a) * (d - b) + 1
	print(x)


from sys import stdin, stdout
import math
from collections import Counter, deque
L = lambda : list(map(int, stdin.readline().strip().split()))
M = lambda : map(int, stdin.readline().strip().split())
I = lambda : int(stdin.readline().strip())
IN = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()
mod = 1000000007

def s(a):
	print(' '.join(list(map(str, a))))
for i in range(I()):
	(x1, y1, x2, y2) = M()
	print((x2 - x1) * (y2 - y1) + 1)


def paths(x1, y1, x2, y2):
	return (x2 - x1) * (y2 - y1) + 1
t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	print(paths(x1, y1, x2, y2))


for _ in range(int(input())):
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	print((x2 - x1) * (y2 - y1) + 1)


for i in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	z = max(x2, y2)
	q = (x2 - x1) * (y2 - y1)
	if q == 0:
		print('1')
	else:
		print(q + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	numr = x2 - x1
	numd = y2 - y1
	print(numr * numd + 1)


import sys
lines = sys.stdin.readlines()
T = int(lines[0].strip())

def cal(a):
	return a * (a + 1) // 2
for t in range(T):
	(a, b, p, q) = map(int, lines[1 + t].strip().split(' '))
	mini = min(p - a, q - b)
	maxi = max(p - a, q - b)
	if mini == 0:
		print(1)
		continue
	res = cal(mini - 1) + cal(mini) + 1
	res += (maxi - mini) * mini
	print(res)


t = int(input())
for t_ in range(t):
	(xa, ya, xb, yb) = map(int, input().split())
	x = xb - xa
	y = yb - ya
	print(x * y + 1)


T = int(input())
while T > 0:
	T -= 1
	val = [int(x) for x in input().split()]
	print((val[2] - val[0]) * (val[3] - val[1]) + 1)


t = int(input())
results = []
for case in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	m = x2 - x1 + 1
	n = y2 - y1 + 1
	mi = min(n, m)
	ma = max(n, m)
	sums = mi + (mi - 1) * (mi - 2) + (ma - mi) * (mi - 1)
	results.append(sums)
for result in results:
	print(result)


import sys
import string
input = sys.stdin.readline
import math
t = int(input())
for i in range(t):
	n = list(map(int, input().split()))
	ans = abs(n[0] - n[2]) * abs(n[3] - n[1])
	print(ans + 1)


import math
import sys
from sys import stdin
input = sys.stdin.readline
for _ in range(int(input())):
	(x1, y1, x2, y2) = [int(j) for j in input().split()]
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		print(abs(x1 - x2) * abs(y1 - y2) + 1)


from math import ceil

def vsum(n):
	res = n * (n + 1) * (n + 2) / 6
	return res

def hsum(n):
	res = n * (n * n + 5) // 6
	return res

def rowpoint(n):
	return n * (n + 1) // 2

def colpoint(n):
	return n * (n - 1) // 2 + 1

def sumOfseries(n, a, d):
	res = n * (a + (n - 1) * d) // 2
	return res
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a == c or b == d:
		ans = 1
	else:
		rows = c - a + 1
		cols = d - b + 1
		ts = rows * cols
		ans = 1 + (ts - (rows + cols - 1))
	print(ans)


q = int(input())
for _ in range(q):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1 + 1) * (y2 - y1 + 1) - (x2 - x1) - (y2 - y1))


n = int(input())
for it in range(n):
	(a, b, c, d) = map(int, input().split())
	(len, wid) = (c - a + 1, d - b + 1)
	(rcorn, lcorn) = (len * (len - 1) // 2 + 1, wid * (wid + 1) // 2)
	print(1 + (wid * (wid + 1) * (wid + 2) // 6 + (len - 1) * (lcorn + wid) + (len - 1) * (len - 2) * (wid + 1) // 2 + (len - 1) * (len - 2) * (len - 3) // 6) - (len * (len * len + 5) // 6 + (wid - 1) * (rcorn + len + 1) + (wid - 1) * (wid - 2) * (len + 2) // 2 + (wid - 1) * (wid - 2) * (wid - 3) // 6))


import sys
import heapq

def main():
	t = int(input())
	for _ in range(t):
		(y1, x1, y2, x2) = map(int, sys.stdin.readline().split())
		if x1 == x2 or y1 == y2:
			print(1)
			continue
		xDiff = x2 - x1
		yDiff = y2 - y1
		if xDiff == 1:
			print(y2 - y1 + 1)
			continue
		if yDiff == 1:
			print(x2 - x1 + 1)
			continue
		upRight = (x1 + y1 - 1) * xDiff + xDiff * (xDiff - 1) // 2
		downLeft = (x1 + y1) * yDiff + yDiff * (yDiff - 1) // 2
		minVal = xDiff * (xDiff + 1) * (x1 + y1 - 1) // 2 + (xDiff * (xDiff + 1) * (2 * xDiff + 1) // 6 - xDiff * (xDiff + 1) // 2) // 2 + yDiff * upRight + yDiff * (yDiff + 1) * (x2 + y1) // 2 + (yDiff * (yDiff + 1) * (2 * yDiff + 1) // 6 - yDiff * (yDiff + 1) // 2) // 2
		maxVal = yDiff * (yDiff + 1) * (x1 + y1) // 2 + (yDiff * (yDiff + 1) * (2 * yDiff + 1) // 6 - yDiff * (yDiff + 1) // 2) // 2 + xDiff * downLeft + xDiff * (xDiff + 1) * (x1 + y2 - 1) // 2 + (xDiff * (xDiff + 1) * (2 * xDiff + 1) // 6 - xDiff * (xDiff + 1) // 2) // 2
		print(maxVal - minVal + 1)
	return
main()


import sys
import math
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
for i in range(int(input())):
	(x1, y1, x2, y2) = intInp()
	if x2 - x1 == 0 or y2 - y1 == 0:
		print(1)
	else:
		a = x2 - x1
		b = y2 - y1
		print(a * b + 1)


t = int(input())
while t:
	(x1, y1, x2, y2) = map(int, input().split())
	r = (x2 - x1) * (y2 - y1) + 1
	print(r)
	t = t - 1


t = int(input())
while t:
	t -= 1
	(x1, y1, x2, y2) = map(int, input().split())
	a = x2 - x1
	b = y2 - y1
	print(a * b + 1)


def solve():
	(x1, y1, x2, y2) = map(int, input().split())
	print((x1 - x2) * (y1 - y2) + 1)

def main():
	for _ in range(int(input())):
		solve()
main()


t = int(input())
for _ in range(t):
	(X, Y, Z, W) = map(int, input().split())
	print((Z - X) * (W - Y) + 1)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	print(int((x2 - x1) * (y2 - y1) + 1))


from sys import stdin
input = stdin.readline

def main():
	test = int(input())
	for _ in range(test):
		count = 0
		s = set()
		l = [int(i) for i in input().split(' ')]
		x1 = l[0]
		y1 = l[1]
		x2 = l[2]
		y2 = l[3]
		print(abs(x2 - x1) * abs(y2 - y1) + 1)
main()


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(i) for i in st()]
for _ in range(val()):
	(a, b, c, d) = li()
	c -= a
	d -= b
	print(1 + c * d)


import math
t = int(input())
for i in range(t, 0, -1):
	s = input().split(' ')
	x1 = int(s[0])
	y1 = int(s[1])
	x2 = int(s[2])
	y2 = int(s[3])
	ans = 0
	if x1 == x2:
		ans = 1
	elif y1 == y2:
		ans = 1
	elif x1 > x2:
		ans = 0
	elif y1 > y2:
		ans = 0
	else:
		m = x2 - x1
		n = y2 - y1
		ans = m * n + 1
	print(int(ans))


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	if y1 > y2 or x1 > x2:
		print(0)
	elif y1 == y2 or x1 == x2:
		print(1)
	else:
		print((y2 - y1) * (x2 - x1) + 1)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def foo():
	(x1, y1, x2, y2) = invr()
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans)
t = inp()
for i in range(t):
	foo()


t = int(input())
for o in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	z = (x2 - x1) * (y2 - y1) + 1
	print(z)


def main():
	from sys import stdin
	from sys import stdout
	input = stdin.readline
	print = stdout.write
	t = int(input())
	for test_ix in range(1, t + 1):
		(x1, y1, x2, y2) = list(map(int, input().split()))
		print('{0}\n'.format((x2 - x1) * (y2 - y1) + 1))
main()


def get1(x):
	return x * (x * x + 5) // 6

def get2(x):
	return x * (x + 1) * (x + 2) // 6

def get11(l, r):
	return get1(r) - get1(l - 1)

def get22(l, r):
	return get2(r) - get2(l - 1)
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	x1 -= 1
	x2 -= 1
	y1 -= 1
	y2 -= 1
	l = get11(x1 + y1 + 1, x1 + y2) + x1 * (y2 - y1) + get22(x1 + y2 + 1, x2 + y2 + 1) - y2 * (x2 - x1 + 1)
	r = get22(x1 + y1 + 1, x2 + y1) - y1 * (x2 - x1) + get11(x2 + y1 + 1, x2 + y2 + 1) + x2 * (y2 - y1 + 1)
	print(r - l + 1)


t = int(input())
for _ in range(t):
	(a, b, x, y) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	one = x * (x + 1) // 2 * (y - b) + y * (y + 1) // 2 * x + y * (y - 1) * (y + 1) // 6 - b * (b - 1) * (b + 1) // 6 - b * (b + 1) // 2 * x
	two = a * (a + 1) // 2 * (y - b) + y * (y + 1) // 2 * a + y * (y - 1) * (y + 1) // 6 - b * (b - 1) * (b + 1) // 6 - b * (b + 1) // 2 * a
	three = (1 + y * (y - 1) // 2) * (x - a) + (y + 1) * (x * (x + 1) - a * (a + 1)) // 2 + x * (x - 1) * (x + 1) // 6 - a * (a - 1) * (a + 1) // 6
	four = (1 + b * (b - 1) // 2) * (x - a) + (b + 1) * (x * (x + 1) - a * (a + 1)) // 2 + x * (x - 1) * (x + 1) // 6 - a * (a - 1) * (a + 1) // 6
	print(one - three - two + four + 1)


import sys
import math
from collections import defaultdict

def solve(test):
	(x1, y1, x2, y2) = map(int, input().split())
	dx = x2 - x1
	dy = y2 - y1
	ans = dx * dy + 1
	print(ans)
test_cases = int(input())
for t in range(1, test_cases + 1):
	solve(t)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = [int(i) for i in input().split()]
	print(abs(x2 - x1) * abs(y2 - y1) + 1)


def main():

	def b1(x):
		return 1 + x * (x - 1) // 2

	def a1(y):
		return y * (y + 1) // 2

	def asum(y, n):
		return a1(y) * n + (n * (n + 1) * (2 * n + 1) // 6 + n * (n + 1) * (2 * y - 3) // 2) // 2 + n * (1 - y)

	def bsum(x, n):
		return b1(x) * n + (n * (n + 1) * (2 * n + 1) // 6 + n * (n + 1) * (2 * x - 1) // 2) // 2 - n * x
	for __ in [0] * int(input()):
		(x1, y1, x2, y2) = map(int, input().split())
		mn = asum(y1, x2) - asum(y1, x1 - 1) + bsum(x2, y2) - bsum(x2, y1)
		mx = bsum(x1, y2) - bsum(x1, y1 - 1) + asum(y2, x2) - asum(y2, x1)
		print(mx - mn + 1)
main()


import sys
import os
import heapq
import math
try:
	path = './file/input.txt'
	if os.path.exists(path):
		sys.stdin = open(path, 'r')
except:
	pass
t = int(input())

def printd(value):
	pass
for _ in range(t):
	arr = list(map(int, input().split(' ')))
	(x1, y1, x2, y2) = (arr[0], arr[1], arr[2], arr[3])
	x = abs(x2 - x1)
	y = abs(y2 - y1)
	if x < y:
		(x, y) = (y, x)
	print(x * y + 1)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
from math import factorial

def gift():
	for _ in range(t):
		(x1, y1, x2, y2) = list(map(int, input().split()))
		yield ((y2 - y1) * (x2 - x1) + 1)
t = int(input())
ans = gift()
print(*ans, sep='\n')


t = int(input())
for _ in range(t):
	x = [int(x) for x in input().split()]
	print((x[2] - x[0]) * (x[3] - x[1]) + 1)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = list(map(lambda x: int(x), input().split()))
	m = x2 - x1 + 1
	n = y2 - y1 + 1
	print((m - 1) * (n - 1) + 1)


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	(x, y) = (x2 - x1, y2 - y1)
	print(x * y + 1)


import sys
import heapq
import random
import collections

def solve(a, b, c, d):
	console('----- solving ------')
	return (d - b) * (c - a) + 1

def console(*args):
	print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)
	return
for case_num in range(int(input())):
	(a, b, c, d) = list(map(int, input().split()))
	res = solve(a, b, c, d)
	print(res)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
from io import BytesIO
import threading
import bisect
import heapq
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
input = sys.stdin.readline
ara = [0] * 100005
listOdd = list()

def aratosfen():
	global ara
	for i in range(2, int(math.sqrt(len(ara)))):
		if ara[i] == 0:
			for j in range(i * 2, len(ara), i):
				ara[j] = 1
	global listOdd
	for i in range(2, len(ara)):
		if ara[i] == 0:
			listOdd.append(i)
aratosfen()
for t in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
		continue
	else:
		rY = y2 - y1 + 1
		rX = x2 - x1 + 1
		answer = rY + max(rX - 2, 0) * max(rY - 1, 1)
		print(answer)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	line = stdin.readline()
	(x1, y1, x2, y2) = map(int, line.split())
	print((x2 - x1) * (y2 - y1) + 1)


import sys
input = sys.stdin.readline
t = int(input())
for test in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	n1 = x2 - x1
	n2 = y2 - y1
	ans = n1 * n2 + 1
	print(int(ans))


import sys
input = sys.stdin.readline

def value(x, y):
	ANS = (x + y - 2) * (x + y - 1) // 2
	return ANS + x
t = int(input())
for tests in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	print(1 + (x2 - x1) * (y2 - y1))


t = int(input())
for i in range(t):
	(x, y, x1, y1) = map(int, input().split())
	print((x1 - x) * (y1 - y) + 1)


from math import factorial as fact

def solve(x1, y1, x2, y2):
	return (x2 - x1) * (y2 - y1) + 1

def main():
	t = int(input())
	i = 1
	while i <= t:
		(x1, y1, x2, y2) = map(int, input().split())
		print(solve(x1, y1, x2, y2))
		i += 1
main()


import sys
LI = lambda : list(map(int, sys.stdin.readline().strip('\n').split()))
MI = lambda : map(int, sys.stdin.readline().strip('\n').split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline().strip('\n'))
for _ in range(II()):
	(x1, y1, x2, y2) = MI()
	print(abs(x2 - x1) * abs(y2 - y1) + 1)


a = int(input())
store = [1] * a
for i in range(a):
	b = input()
	c = [int(x) for x in b.split()]
	store[i] = (c[2] - c[0]) * (c[3] - c[1]) + 1
for i in range(a):
	print(store[i])


for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	print(abs(a - c) * abs(b - d) + 1)


def solution():
	(x1, y1, x2, y2) = map(lambda x: int(x), input().split())
	print((x2 - x1) * (y2 - y1) + 1)
t = int(input())
for _ in range(t):
	solution()


def rs():
	return input().strip()

def ri():
	return int(input())

def ria():
	return list(map(int, input().split()))

def ia_to_s(a):
	return ' '.join([str(s) for s in a])

def solve(x1, y1, x2, y2):
	return (x2 - x1) * (y2 - y1) + 1

def main():
	for _ in range(ri()):
		(x1, y1, x2, y2) = ria()
		print(solve(x1, y1, x2, y2))
main()


import math
t = int(input())
while t:
	(x1, y1, x2, y2) = [int(a) for a in input().split()]
	t -= 1
	print((x2 - x1) * (y2 - y1) + 1)


import math

def rn():
	a = int(input())
	return a

def rl():
	a = list(map(int, input().split()))
	return a
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	d1 = x2 - x1
	d2 = y2 - y1
	sp = d1 + d2 - 1
	md = min(d1, d2)
	ans = md * (md + 1)
	ans = ans - (2 * md - sp) * md
	print(ans + 1)


import sys
input = sys.stdin.readline

def intInput():
	return int(input())

def intListInput():
	return list(map(int, input().split()))

def strInput():
	return input()
from queue import Queue
import math
import operator as op
from functools import reduce

def brute(r1, c1, r2, c2):
	N = 5 * max([r1, c1, r2, c2])
	grid = [[0 for _ in range(N + 1)] for _ in range(N + 1)]
	q = Queue()
	q.put((0, 0))
	curr = 1
	while not q.empty():
		(r, c) = q.get()
		if r > N or c > N or grid[r][c] != 0:
			continue
		grid[r][c] = curr
		curr += 1
		q.put((r, c + 1))
		q.put((r + 1, c))
	foundSums = set([])

	def dfs(r, c, currSum):
		if r == r2 and c == c2:
			foundSums.add(currSum + grid[r][c])
			return
		elif r <= r2 and c <= c2:
			dfs(r, c + 1, currSum + grid[r][c])
			dfs(r + 1, c, currSum + grid[r][c])
	dfs(r1, c1, 0)
	return len(foundSums)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def soln(r1, c1, r2, c2):
	dr = r2 - r1
	dc = c2 - c1
	return dr * dc + 1

def main():
	t = int(input())
	for _ in range(t):
		(x1, y1, x2, y2) = [int(x) for x in input().split()]
		r1 = x1 - 1
		c1 = y1 - 1
		r2 = x2 - 1
		c2 = y2 - 1
		result = soln(x1, y1, x2, y2)
		print(result)

def randomTest():
	import random
	t = 10000
	for i in range(1, t + 1):
		r1 = random.randint(0, 5)
		c1 = random.randint(0, 5)
		r2 = random.randint(5, 8)
		c2 = random.randint(5, 8)
		print(i, r1, c1, r2, c2)
		b = brute(r1, c1, r2, c2)
		f = soln(r1, c1, r2, c2)
		if b != f:
			print('Broken!')
			print(b, f)
			return
main()


from collections import defaultdict
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange

def print_case_iterable(case_num, iterable):
	print('Case #{}: {}'.format(case_num, ' '.join(map(str, iterable))))

def print_case_number(case_num, iterable):
	print('Case #{}: {}'.format(case_num, iterable))

def print_iterable(A):
	print(' '.join(A))

def read_int():
	return int(f.readline().strip())

def read_int_array():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def read_string():
	return list(f.readline().strip())

def bi(x):
	return bin(x)[2:]
from collections import deque

def solution(x, y, z, w):
	size_x = z - x + 1
	size_y = w - y + 1
	return 1 + (size_x - 1) * (size_y - 1)

def main():
	T = read_int()
	for i in range(T):
		(x, y, z, w) = read_int_array()
		x = solution(x, y, z, w)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			(print >> output, str(x))
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()
if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()
main()


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	n = x2 - x1
	p = y2 - y1
	print(n * p + 1)


from math import factorial

def list_input():
	return list(map(int, input().split()))

def multiple_input():
	return map(int, input().split())
for _ in range(int(input())):
	(a, b, c, d) = multiple_input()
	r = abs(a - c)
	l = abs(b - d)
	ans = l * r + 1
	print(ans)


T = int(input())
for i in range(T):
	(X1, Y1, X2, Y2) = map(int, input().split())
	XD = X2 - X1
	YD = Y2 - Y1
	N = XD * YD + 1
	print(N)


t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().rstrip().split())
	print((c - a) * (d - b) + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	dx = x2 - x1
	dy = y2 - y1
	print(dx * dy + 1)
import sys
sys.exit(0)
arr = [[0] * 1000 for _ in range(1000)]
sets = [[set() for _ in range(1000)] for _ in range(1000)]
c = 1
for i in range(1, 200):
	for j in range(i):
		arr[j][i - j - 1] = c
		c += 1
print(*[r[:20] for r in arr[:20]], sep='\n')
sets[0][0].add(arr[0][0])
for x in range(20):
	for y in range(20):
		v = arr[x][y]
		if x > 0:
			sets[x][y] = sets[x][y] | sets[x - 1][y]
		if y > 0:
			sets[x][y] = sets[x][y] | sets[x][y - 1]
		sets[x][y] = set([v + val for val in sets[x][y]])
print(*[[len(s) for s in r[:20]] for r in sets[:20]], sep='\n')


for _ in range(int(input())):
	(a1, a2, b1, b2) = [int(x) for x in input().split()]
	r = abs(a1 - b1)
	c = abs(a2 - b2)
	print(r * c + 1)


import sys
input = sys.stdin.readline
from collections import Counter
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	ans = 0
	n = min(x2 - x1, y2 - y1)
	m = max(x2 - x1, y2 - y1) - n
	ans = n * (n + 1) + n * (m - 1)
	print(ans + 1)


import sys
for t in range(int(sys.stdin.readline())):
	(x1, y1, x2, y2) = map(int, sys.stdin.readline().split())
	(x, y) = (x2 - x1, y2 - y1)
	if 0 in (x, y):
		sys.stdout.write(f'{1}\n')
	else:
		sys.stdout.write(f'{x * y + 1}\n')


from sys import stdout, stdin
import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	(x, y, u, v) = map(int, input().split())
	stdout.write(str((u - x) * (v - y) + 1) + '\n')


import sys, math, collections
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	print((c - a) * (d - b) + 1)


from math import factorial as fact
t = int(input())
for _ in range(t):
	(a, b, x, y) = map(int, input().split())
	ans = (x - a) * (y - b) + 1
	print(ans)


def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	(x1, y1, x2, y2) = read_ints()
	d1 = x2 - x1
	d2 = y2 - y1
	print(d1 * d2 + 1)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	m = x2 - x1
	n = y2 - y1
	print(n * m + 1)


from math import *
t = int(input())

def sol(r1, c1, r2, c2):
	h = r2 - r1 + 1
	w = c2 - c1 + 1
	return h * w - h - w + 2
for _ in range(t):
	print(sol(*map(int, input().split())))


(T, *I) = map(int, open(0).read().split())
for (x1, y1, x2, y2) in zip(*[iter(I)] * 4):
	a = x2 - x1
	b = y2 - y1
	print(a * b + 1)


from math import *
from collections import *
from operator import itemgetter
import bisect
from heapq import *
i = lambda : input()
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for _ in range(t):
	(x1, y1, x2, y2) = iia()
	l = x2 - x1 + 1
	b = y2 - y1 + 1
	print((b - 1) * (l - 1) + 1)


t = int(input())
for i in range(t):
	(a1, b1, c1, d1) = input().split(' ')
	a = int(a1)
	b = int(b1)
	c = int(c1)
	d = int(d1)
	print(1 + (c - a) * (d - b))


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	xdifference = x2 - x1
	ydifference = y2 - y1
	result2 = 1 + (x2 - x1) * ydifference
	print(result2)


def cellex(x1, y1, x2, y2):
	dx = x2 - x1
	dy = y2 - y1
	return dx * dy + 1
test_cases = int(input())
inp = []
for i in range(test_cases):
	lst = list(map(lambda elem: int(elem), input().split(' ')))
	inp.append(lst)
for lst in inp:
	print(cellex(lst[0], lst[1], lst[2], lst[3]))


t = int(input())
while t > 0:
	t = t - 1
	(x1, y1, x2, y2) = map(int, input().split(' '))
	a = x1 - x2
	b = y1 - y2
	if a > 0 or b > 0:
		print(1)
	else:
		a = -a
		b = -b
		if a == 0 or b == 0:
			print(1)
		else:
			print(a * b + 1)


def answer(n, m):
	return (n - 1) * (m - 1) + 1
t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	n = y2 - y1 + 1
	m = x2 - x1 + 1
	print(answer(n, m))


t = int(input())
for _ in range(t):
	(a1, a2, b1, b2) = map(int, input().split())
	print((b2 - a2) * (b1 - a1) + 1)


def f(x1, y1, x2, y2):
	m = x2 - x1
	n = y2 - y1
	a = min(m, n)
	b = max(m, n)
	return a * (a + 1) + (b - a - 1) * a + 1
t = int(input())
for i in range(t):
	xy = input().rstrip().split()
	x1 = int(xy[0])
	x2 = int(xy[2])
	y1 = int(xy[1])
	y2 = int(xy[3])
	print(f(x1, y1, x2, y2))


t = int(input())
for test in range(0, t):
	(x1, y1, x2, y2) = input().split()
	(x1, y1, x2, y2) = (int(x1), int(y1), int(x2), int(y2))
	a = x2 - x1
	b = y2 - y1
	print(a * b + 1)


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if y1 == y2 or x1 == x2:
		print(1)
		continue
	ans = 2 + (y2 - y1 - 1) * (x2 - x1) + (x2 - x1 - 1)
	print(ans)


t = int(input())
for it in range(t):
	inp = input().strip().split()
	x1 = int(inp[0])
	y1 = int(inp[1])
	x2 = int(inp[2])
	y2 = int(inp[3])
	print('{}'.format((x2 - x1) * (y2 - y1) + 1))


import sys
buff_readline = sys.stdin.readline
readline = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(buff_readline())

def read_int_n():
	return list(map(int, buff_readline().split()))

def read_float():
	return float(buff_readline())

def read_float_n():
	return list(map(float, buff_readline().split()))

def read_str():
	return readline().strip()

def read_str_n():
	return readline().strip().split()

def error_print(*args):
	print(*args, file=sys.stderr)

def slv(X1, Y1, X2, Y2):
	return (X2 - X1) * (Y2 - Y1) + 1

def main():
	T = read_int()
	for _ in range(T):
		(X1, Y1, X2, Y2) = read_int_n()
		print(slv(X1, Y1, X2, Y2))
main()


import sys
sys.setrecursionlimit(10 ** 8)
ni = lambda : int(sys.stdin.readline())
nm = lambda : map(int, sys.stdin.readline().split())
nl = lambda : list(nm())
ns = lambda : sys.stdin.readline().rstrip()

def main():
	T = ni()
	for _ in range(T):
		(x1, y1, x2, y2) = nm()
		print((x2 - x1) * (y2 - y1) + 1)
main()


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]
t = int(input())
for q in range(t):
	(x1, y1, x2, y2) = inputnums()
	print((x2 - x1) * (y2 - y1) + 1)


for t in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	x = x1 * (y2 - y1)
	y = x2 * (y2 - y1)
	print(y - x + 1)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = I()
	rr = []
	for _ in range(t):
		(x1, y1, x2, y2) = LI()
		s = sorted([x2 - x1, y2 - y1])
		r = s[0] * (s[0] + 1) // 2 * 2 - s[0]
		t = s[1] - s[0]
		r += t * s[0]
		rr.append(r + 1)
	return JA(rr, '\n')
print(main())


def solve(a, b, c, d):
	return (a - c) * (b - d) + 1

def main():
	t = int(input())
	for i in range(t):
		d = input()
		d = [int(i) for i in d.split()]
		n = d[0]
		a = d[1]
		b = d[2]
		c = d[3]
		ans = solve(n, a, b, c)
		print(ans)
main()


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	print((x - a) * (y - b) + 1)


import sys
readline = sys.stdin.readline
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))

def solve():
	(p, q, r, s) = nm()
	y = r - p
	x = s - q
	print(y * x + 1)
	return
T = int(input())
for _ in range(T):
	solve()


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	(dx, dy) = (x2 - x1, y2 - y1)
	r = dx * dy + 1
	print(r)


t = int(input())
for i in range(t):
	a = []
	a = list(map(int, input().split()))
	ans = (a[3] - a[1]) * (a[2] - a[0]) + 1
	print(ans)


t = int(input())
for i in range(t):
	(a, b, c, d) = list(map(int, input().split()))
	print((a - c) * (b - d) + 1)


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def solve():
	(x1, y1, x2, y2) = read_ints()
	return (x2 - x1) * (y2 - y1) + 1
T = read_int()
for _ in range(T):
	print(solve())


t = int(input())
while t:
	a = list(map(int, input().split()))
	print(1 + abs(a[3] - a[1]) * abs(a[0] - a[2]))
	t -= 1


def main():
	test = int(input())
	for _ in range(test):
		(x1, y1, x2, y2) = map(int, input().split())
		ans = (x2 - x1) * (y2 - y1) + 1
		print(ans)
main()


def solve():
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	print(abs(x2 - x1) * abs(y2 - y1) + 1)
t = int(input())
for i in range(t):
	solve()


def main():
	(a, b, c, d) = map(int, input().split())
	print((c - a) * (d - b) + 1)
t = int(input())
for _ in range(t):
	main()


for cas in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


q = int(input())
for i in range(q):
	(a, b, c, d) = map(int, input().split())
	e = c - a
	d = d - b
	f = e + d
	print(e * d + 1)


def main():
	(a, b, c, d) = map(int, input().split())
	diffx = c - a
	diffy = d - b
	print(diffx * diffy + 1)
	return

def test():
	t = int(input())
	while t:
		main()
		t -= 1
test()


from collections import defaultdict as dd
import math
import sys
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))
q = nn()
for _ in range(q):
	(x1, y1, x2, y2) = mi()
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		r = x2 - x1 + y2 - y1
		picks = x2 - x1
		diff = r - picks
		lower = picks * (picks - 1) // 2
		upper = r * (r - 1) // 2 - (r - picks) * (r - picks - 1) // 2
		print(upper - lower + 1)


import sys
input = sys.stdin.buffer.readline

def iinp() -> int:
	return int(input())

def linp() -> list:
	return [int(p) for p in input().split()]

def sinp():
	return input().decode('unicode-escape')[0:-2]
t = iinp()
for _ in range(t):
	(a, b, m, n) = linp()
	print((a - m) * (b - n) + 1)


from math import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(xa, ya, xb, yb) = [int(x) for x in input().split()]
	m = abs(xa - xb)
	n = abs(ya - yb)
	print(m * n + 1)


def cal(a, b):
	c = a + b - 2
	return (1 + c) * c // 2 + a
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	(a, b, c, d) = (cal(x1, y1), cal(x1, y2), cal(x2, y1), cal(x2, y2))
	ans = (x2 - x1 + 1) * (a + c - b - d) // 2 + (y2 - y1 + 1) * (c + d - b - a) // 2 - c + b + 1
	print(ans)


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a == c or b == d:
		print(1)
	else:
		s = (c - a) * (d - b) + 1
		print(s)


import sys, heapq
from collections import *
from functools import lru_cache
sys.setrecursionlimit(10 ** 6)
import operator as op
from functools import reduce

def main():

	def ncr(n, r):
		r = min(r, n - r)
		numer = reduce(op.mul, range(n, n - r, -1), 1)
		denom = reduce(op.mul, range(1, r + 1), 1)
		return numer // denom
	t = int(input())
	for _ in range(t):
		(x1, y1, x2, y2) = map(int, input().split(' '))
		(x, y) = (x2 - x1, y2 - y1)
		print(x * y + 1)
main()


t = int(input())
for _ in range(t):
	l = []
	l = list(map(int, input().split()))
	x1 = l[0]
	y1 = l[1]
	x2 = l[2]
	y2 = l[3]
	print((y2 - y1) * (x2 - x1) + 1)


t = int(input())
ans = [1] * t
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	a = x2 - x1
	b = y2 - y1
	minab = min(a, b)
	ans[i] += (minab + 1) * minab - minab
	ans[i] += minab * abs(a - b)
for i in range(t):
	print(int(ans[i]))


def solve(x1, y1, x2, y2):
	ans = (y2 - y1) * (x2 - x1) + 1
	return ans

def main():
	t = int(input())
	for i in range(t):
		(x1, y1, x2, y2) = list(map(int, input().split()))
		ans = solve(x1, y1, x2, y2)
		print(ans)
main()


t = int(input())
for T in range(t):
	(a, b, n, m) = [int(x) for x in input().split()]
	ans = (n - a) * (m - b) + 1
	print(ans)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	print(1 + (x - a) * (y - b))


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = (int(_) for _ in input().split())
	delta_x = x2 - x1
	delta_y = y2 - y1
	print(delta_x * delta_y + 1)


from collections import Counter, defaultdict, deque
from math import *
import sys
input = sys.stdin.readline

def solve():
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	dx = x2 - x1
	dy = y2 - y1
	print(dx * dy + 1)
tt = int(input())
for test in range(tt):
	solve()


from math import *
from sys import stdin, stdout
input = stdin.buffer.readline
t = int(input())
while t > 0:
	ip = [int(x) for x in input().split()]
	x1 = ip[0]
	y1 = ip[1]
	x2 = ip[2]
	y2 = ip[3]
	print((x2 - x1) * (y2 - y1) + 1)
	t -= 1


from sys import stdin
input = stdin.readline
import bisect
import math

def t(x):
	p = x - 1 + (x - 1) * (x - 2) // 2
	return p + 1

def s(n):
	return (n + 1) * n // 2

def sss(a, x, r, n):
	p = n * a + n * (n - 1) * x // 2 + r * n * (n - 1) * (n - 2) // 2 - r * ((n - 2) * (n - 1) * (2 * n - 3) // 6 + (n - 2) * (n - 1) // 2)
	return p
for xoxo in range(1):
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		(x, y) = (0, 0)
		(sx1, sx2) = (s(x1), s(x2))
		x = sss(sx1, x1, 1, y2) - sss(sx1, x1, 1, y1 - 1)
		y = sss(sx2, x2, 1, y2) - sss(sx2, x2, 1, y1 - 1)
		y += sss(t(y1), y1 + 1, 1, x2 - 1) - sss(t(y1), y1 + 1, 1, x1 - 1)
		x += sss(t(y2), y2 + 1, 1, x2) - sss(t(y2), y2 + 1, 1, x1)
		print(abs(y - x) + 1)


for __ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	x = abs(a - c)
	y = abs(b - d)
	print(x * y + 1)


for _ in range(int(input())):
	l = list(map(int, input().rstrip().split(' ')))
	m = l[2] - l[0] + 1
	n = l[3] - l[1] + 1
	(m, n) = (min(m, n), max(m, n))
	if m == 0 or n == 0:
		print(1)
	else:
		t = (m - 1) * (n - m + 1)
		t += (m - 2) * (m - 1) + 1
		print(t)


for _ in range(int(input())):
	a = list(map(int, input().split()))
	print((a[2] - a[0]) * (a[3] - a[1]) + 1)


def solve(inp_arr):
	ans = 0
	dx = inp_arr[2] - inp_arr[0]
	dy = inp_arr[3] - inp_arr[1]
	n = dx + dy - 1
	m = min(dx, dy)
	if m == 0:
		ans = 1
	elif (dx, dy) == (1, 1):
		ans = 2
	elif n == 2 * m - 1:
		ans = m * m + 1
	else:
		ans = m * (n + 1 - m) + 1
	return ans
t = int(input())
for ___ in range(t):
	inp_arr = [int(k) for k in input().split(' ')]
	answer = solve(inp_arr)
	print(answer)


import sys
input = sys.stdin.readline
for nt in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	n = x2 - x1
	m = y2 - y1
	print(n * m + 1)


import math
t = int(input())
for i in range(t):
	l = list(map(int, input().strip().split()))
	x = l[0]
	y = l[1]
	x1 = l[2]
	y1 = l[3]
	a = x1 - x
	b = y1 - y
	print(a * b + 1)


from math import factorial as fact

def ncr(x1, y1, x2, y2):
	w = x2 - x1 + 1
	h = y2 - y1 + 1
	return int((w - 1) * (h - 1) + 1)

def main():
	for i in range(int(input())):
		(x1, y1, x2, y2) = list(map(int, input().split(' ')))
		print(ncr(x1, y1, x2, y2))
main()


def solve():
	t = int(input())
	while t > 0:
		(x1, y1, x2, y2) = map(int, input().strip().split())
		p = x2 - x1
		q = y2 - y1
		m = p * q + 1
		print(m)
		t -= 1
solve()


T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	x = x2 - x1 + 1
	y = y2 - y1 + 1
	a = min(x, y)
	b = max(x, y)
	kiso = (a - 1) ** 2
	if a == 1:
		ans = 0
	else:
		ans = kiso + (b - a) * (a - 1)
	print(ans + 1)


def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def solve(x1, y1, x2, y2):
	rows = x2 - x1
	cols = y2 - y1
	if rows == 0 or cols == 0:
		return 1
	small = min(rows, cols)
	value = (small + 1) * small
	value += small * (abs(rows - cols) - 1)
	return int(1 + value)
test_cases = inp()
for i in range(test_cases):
	(x1, y1, x2, y2) = inlt()
	print(solve(x1, y1, x2, y2))


import sys
t = int(input().strip())
for a0 in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	print((x2 - x1) * (y2 - y1) + 1)


from sys import stdin, stdout
input = stdin.readline
print = stdout.write

def pos(x, y):
	return x * (x + 1) // 2 + x * (y - 1) + (y - 1) * (y - 2) // 2
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	diff = x1 + y1 - 1
	x3 = x2 - x1 + 1
	y3 = y2 - y1 + 1
	st = pos(x1, y1)
	mn = y3 * st + y3 * (y3 - 1) * diff // 2 + (y3 - 1) * (y3 - 2) // 2
	diff = x1 + y2
	st = pos(x1, y2)
	mn += st * (x3 - 1) + x3 * (x3 - 1) * diff // 2 + (x3 - 1) * (x3 - 2) // 2
	diff = x1 + y1
	st = pos(x1, y1)
	mx = st * x3 + x3 * (x3 - 1) * diff // 2 + (x3 - 2) * (x3 - 1) // 2
	diff = x2 + y1 - 1
	st = pos(x2, y1)
	mx += st * (y3 - 1) + y3 * (y3 - 1) * diff // 2 + (y3 - 2) * (y3 - 1) // 2
	print(f'{abs(mx - mn) + 1}\n')


import os
import heapq
import sys
import math
from collections import defaultdict
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		val1 = abs(y2 - y1)
		val2 = abs(x2 - x1)
		print(val1 * val2 + 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t:
	t = t - 1
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		c = y2 - y1
		r = x2 - x1
		print(r * c + 1)


nb_cases = int(input())
for c in range(nb_cases):
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	x = x2 - x1 + 1
	y = y2 - y1 + 1
	if x > y:
		temp = x
		x = y
		y = temp
	print(int((x - 1) * (x - 2) + (x - 1)) + (y - x) * (x - 1) + 1)
(1, 2)
(2, 4)
(2, 3)


import math

def nck(n, k):
	return math.factorial(n) // (math.factorial(n - k) * math.factorial(k))
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		x = x2 - x1
		y = y2 - y1
		print(1 + x * y)


try:
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		x_diff = abs(x2 - x1)
		y_diff = abs(y2 - y1)
		print(x_diff * y_diff + 1)
except:
	pass


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)
from sys import stdin
import math
from collections import Counter
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	var = abs(c - a)
	cnt = abs(d - b)
	print(var * cnt + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = tuple(map(int, input().split()))
	print((x2 - x1) * (y2 - y1) + 1)


def numberOfPaths(p, q):
	dp = [1 for i in range(q)]
	for i in range(p - 1):
		for j in range(1, q):
			dp[j] += dp[j - 1]
	return dp[q - 1]
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split(' '))
	m = x2 - x1 + 1
	n = y2 - y1 + 1
	print((x2 - x1) * (y2 - y1) + 1)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = [int(i) for i in input().split()]
	n = x2 - x1
	m = y2 - y1
	print(n * m + 1)


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	print(min(c - a, d - b) * (abs(c - a - (d - b)) + min(c - a, d - b)) + 1)


import math as mt
import sys, string
input = sys.stdin.readline
from collections import defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())

def numberOfPaths(m, n):
	path = 1
	for i in range(n, m + n - 1):
		path *= i
		path //= i - n + 1
	return path
t = I()
for i in range(t):
	(a, b, c, d) = M()
	x = c - a
	y = d - b
	print(1 + x * y)


def sigma(x):
	return x * (x + 1) // 2

def GetAtCell(x, y):
	return sigma(x + y - 2) + x
t = int(input())
for _x in range(t):
	s = input().split()
	(x1, y1, x2, y2) = (int(s[0]), int(s[1]), int(s[2]), int(s[3]))
	K = GetAtCell(x1, y1)
	L = GetAtCell(x1, y2)
	M = GetAtCell(x2, y1)
	dy = y2 - y1
	dx = x2 - x1
	lk = L - K - sigma(dy)
	mk = M - K - sigma(dx)
	res = lk * dx - mk * dy
	if res < 0:
		res = res * -1
	print(res + 1)


from __future__ import division, print_function
import itertools
import sys
import os
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def is_it_local():
	script_dir = str(os.getcwd()).split('/')
	username = 'dipta007'
	return username in script_dir

def READ(fileName):
	if is_it_local():
		sys.stdin = open(f'./{fileName}', 'r')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if not is_it_local():
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')

def input1(type=int):
	return type(input())

def input2(type=int):
	[a, b] = list(map(type, input().split()))
	return (a, b)

def input3(type=int):
	[a, b, c] = list(map(type, input().split()))
	return (a, b, c)

def input_array(type=int):
	return list(map(type, input().split()))

def input_string():
	s = input()
	return list(s)
arr = []
s = set()
mp = {}
(a, b, c, d) = (0, 0, 0, 0)

def call(i, j, sum):
	global arr
	if i > c or j > d:
		return
	if i == c and j == d:
		tot = sum + arr[i][j]
		s.add(tot)
		if tot not in mp:
			mp[tot] = 0
		mp[tot] += 1
		return
	call(i + 1, j, sum + arr[i][j])
	call(i, j + 1, sum + arr[i][j])

def generate():
	global arr
	SZ = 100
	arr = [[0 for _ in range(SZ)] for _ in range(SZ)]
	cnt = 1
	for i in range(SZ):
		(r, c) = (0, i)
		for j in range(c, -1, -1):
			arr[r][j] = cnt
			r += 1
			cnt += 1

def main():
	generate()
	t = input1()
	for ci in range(t):
		global a, b, c, d, s, mp
		[a, b, c, d] = input_array()
		print((c - a) * (d - b) + 1)
	pass
main()


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		(x1, y1, x2, y2) = MI()
		n = x2 - x1 + 1
		m = y2 - y1 + 1
		if n > m:
			(n, m) = (m, n)
		ans = (n - 2) * (n - 1) + (n - 1) * (m - n + 1) + 1
		print(ans)
main()


t = int(input())
while t:
	t -= 1
	(a, b, c, d) = map(int, input().split())
	print((a - c) * (b - d) + 1)


from sys import stdin, exit
input = stdin.readline

def i():
	return input()

def ii():
	return int(input())

def iis():
	return map(int, input().split())

def liis():
	return list(map(int, input().split()))

def print_array(a):
	print(' '.join(map(str, a)))
t = ii()
for _ in range(t):
	(x1, y1, x2, y2) = iis()
	x = x2 - x1
	y = y2 - y1
	print(x * y + 1)


import sys

class Scanner:

	def __init__(self):
		self.tokens = self.get_tokens()

	def next_token(self):
		return next(self.tokens)

	def get_tokens(self):
		for line in sys.stdin:
			for token in line.split():
				yield token
		yield None

def get_ap_sum(a, d, n):
	x = 2 * a + (n - 1) * d
	return x * n >> 1

def get_first_row_sum(n):
	return n * (n * n + 5) // 6

def get_row_sum(r, n):
	a = (r * (r + 1) >> 1) - 1
	d = r - 1
	return get_first_row_sum(n) + get_ap_sum(a, d, n)

def get_first_col_sum(n):
	return n * (n + 1) * (n + 2) // 6

def get_col_sum(c, n):
	a = c * (c - 1) >> 1
	d = c - 1
	return get_first_col_sum(n) + get_ap_sum(a, d, n)

def solve(x1, y1, x2, y2):
	v1 = get_row_sum(x1, y2) - get_row_sum(x1, y1 - 1) + get_col_sum(y2, x2) - get_col_sum(y2, x1)
	v2 = get_col_sum(y1, x2) - get_col_sum(y1, x1 - 1) + get_row_sum(x2, y2) - get_row_sum(x2, y1)
	return abs(v1 - v2) + 1

def main(args):
	sc = Scanner()
	out = []
	t = int(sc.next_token())
	for _ in range(t):
		x1 = int(sc.next_token())
		y1 = int(sc.next_token())
		x2 = int(sc.next_token())
		y2 = int(sc.next_token())
		out.append(solve(x1, y1, x2, y2))
	print('\n'.join((str(x) for x in out)))
sys.exit(main(sys.argv))


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')
tests = lambda : range(1, int_in() + 1)
case_out = lambda i, o: out('Case #{}: {}'.format(i, o))

def solve(x1, y1, x2, y2):
	return (x2 - x1) * (y2 - y1) + 1
for i in tests():
	(x1, y1, x2, y2) = arr_in()
	out(solve(x1, y1, x2, y2))


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	d = a - x
	c = b - y
	print(d * c + 1)


from collections import Counter
from collections import defaultdict
from collections import deque
import math
import heapq
import sys
input = sys.stdin.readline
from bisect import *
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rls = lambda : list(map(str, input().split()))
t = int(input())
for _ in range(0, t):
	(a, b, c, d) = rl()
	s1 = c - a
	s2 = d - b
	ans = s1 * s2
	print(ans + 1)


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	if a == c or b == d:
		print('1')
	else:
		print((c - a) * (d - b) + 1)


import math
from fractions import Fraction

def choose(n, k):
	if k > n // 2:
		k = n - k
	p = Fraction(1)
	for i in range(1, k + 1):
		p *= Fraction(n - i + 1, i)
	return int(p)
T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	minx = min(x1, x2) - 1
	x1 -= minx
	x2 -= minx
	miny = min(y1, y2) - 1
	y1 -= miny
	y2 -= miny
	ans = x2 * y2 - (x2 + y2 - 1) + 1
	print(ans)


test_cases = int(input())
for _ in range(test_cases):
	coordinates = input().split()
	(x1, y1, x2, y2) = (int(coordinates[0]), int(coordinates[1]), int(coordinates[2]), int(coordinates[3]))
	print((x2 - x1) * (y2 - y1) + 1)


import sys
from sys import stdin, stdout

def R():
	return map(int, stdin.readline().strip().split())
from math import *

def printNcR(n, r):
	p = 1
	k = 1
	if n - r < r:
		r = n - r
	if r != 0:
		while r:
			p *= n
			k *= r
			m = gcd(p, k)
			p //= m
			k //= m
			n -= 1
			r -= 1
	else:
		p = 1
	return p
anss = []
for h in range(int(stdin.readline())):
	(x1, y1, x2, y2) = R()
	D = x2 - x1
	r = y2 - y1
	anss.append(str(D * r + 1))
stdout.write('\n'.join(anss))


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
dgnl = lambda x: sqrt(2 * x ** 2)
for _ in range(I()):
	(x, y, a, b) = R()
	print((a - x) * (b - y) + 1)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	a = [int(i) for i in input().split()]
	(x1, y1, x2, y2) = (a[0], a[1], a[2], a[3])
	if x1 == x2 or y1 == y2:
		print(1)
		continue
	x = x2 - x1
	y = y2 - y1
	print(x * y + 1)


for _ in range(int(input())):
	(x1, y1, x2, y2) = tuple(map(int, input().split()))
	(dx, dy) = (x2 - x1, y2 - y1)
	if dx < 0 or dy < 0:
		print(0)
	else:
		print(dx * dy + 1)


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	t = x2 - x1 + (y2 - y1) - 1
	m = min(x2 - x1, y2 - y1)
	if t <= (m - 1) * 2:
		if t % 2 == 1:
			ans = t // 2 * (t // 2 + 1) + t // 2 + 1
		else:
			ans = t // 2 * (t // 2 + 1)
	else:
		ans = (m - 1) * m
		t -= (m - 1) * 2
		ans += t * m
	print(ans + 1)


import math
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	p = (x2 - x1) * (y2 - y1)
	print(p + 1)


import sys
input = sys.stdin.buffer.readline

def int_input() -> int:
	return int(input())

def list_input() -> list:
	return [int(num) for num in input().split()]

def string_input():
	return input().decode('unicode-escape')[0:-2]

def main():
	test = int_input()
	for _ in range(test):
		(x1, y1, x2, y2) = list_input()
		ans = (x2 - x1) * (y2 - y1) + 1
		print(ans)
main()


def f(x1, y1, x2, y2):
	if x1 > x2 or y1 > y2:
		return 0
	else:
		return 1 + (x2 - x1) * (y2 - y1)
t = int(input())
for i in range(t):
	[x1, y1, x2, y2] = input().split(' ')
	print(f(int(x1), int(y1), int(x2), int(y2)))


import sys
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


import math, sys, bisect
from collections import defaultdict, Counter, deque

def input():
	return sys.stdin.readline().strip()
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])
for _ in range(int(input())):
	(x1, y1, x2, y2) = ilele()
	print((x2 - x1) * (y2 - y1) + 1)


from collections import Counter
import math
import sys
from bisect import bisect, bisect_left, bisect_right

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for _ in range(INT()):
	(x1, y1, x2, y2) = MAP()
	n = x2 - x1
	m = y2 - y1
	print(m * n + 1)


import math
t = int(input())
ans = []
for x in range(t):
	inp = list(map(int, input().split()))
	(x1, y1, x2, y2) = (inp[0], inp[1], inp[2], inp[3])
	ans.append((x2 - x1) * (y2 - y1) + 1)
for a in ans:
	print(a)


import sys
from math import factorial as f
input = sys.stdin.readline

def tri(n):
	return n * (n + 1) // 2
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	(x, y) = (min(x2 - x1, y2 - y1), max(x2 - x1, y2 - y1))
	if not x or not y:
		print(1)
		continue
	ans = tri(x - 1) * 2 + x * (y - x + 1)
	print(ans + 1)


t = int(input())
for i in range(t):
	num1 = list(map(int, input().split()))
	x = num1[2] - num1[0]
	y = num1[3] - num1[1]
	print(x * y + 1)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans)


def s(n):
	return n * (n + 1) // 2

def s3(n, d):
	return n * (n * n - 1 - 3 * d * (d - 1)) // 6

def s2(d, n):
	n = n + d - 1
	return s3(n, d) - s3(d - 1, d)

def f(x, y, dx):
	a = s(x + y - 2) + x
	ans = a * dx + s2(x + y - 1, dx)
	return ans

def g(x, y, dx):
	a = s(x + y - 2) + x
	ans = a * dx + s2(x + y, dx)
	return ans

def h(x, y):
	return s(x + y - 2) + x
T = int(input())
for kase in range(T):
	(X1, Y1, X2, Y2) = input().split()
	X1 = int(X1)
	Y1 = int(Y1)
	X2 = int(X2)
	Y2 = int(Y2)
	dx = X2 - X1 + 1
	dy = Y2 - Y1 + 1
	ans1 = f(X1, Y1, dy) + g(X1, Y2, dx) - h(X1, Y2)
	ans2 = f(X2, Y1, dy) + g(X1, Y1, dx) - h(X2, Y1)
	print(ans2 - ans1 + 1)


for _ in range(int(input())):
	l = [int(i) for i in input().split()]
	print((l[2] - l[0]) * (l[3] - l[1]) + 1)


import sys
pprint = lambda s: print(' '.join(map(str, s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	print(1 + (x1 - x2) * (y1 - y2))


from sys import stdin
for case in range(int(stdin.readline())):
	(x1, y1, x2, y2) = [int(x) for x in stdin.readline().split()]
	xDiff = x2 - x1
	yDiff = y2 - y1
	print(xDiff * yDiff + 1)


import sys
imput = sys.stdin.buffer.readline

def print(val):
	sys.stdout.write(str(val) + '\n')

def prog():
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		x = abs(x2 - x1)
		y = abs(y2 - y1)
		a = min(x, y)
		b = max(x, y)
		ans = 1
		ans += a * (a - 1) + a
		ans += a * (b - a)
		print(ans)
prog()


from sys import stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
(t,) = rl()
for _ in range(t):
	(x1, y1, x2, y2) = rl()
	dx = x2 - x1
	dy = y2 - y1
	print(dx * dy + 1)


from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect
import math
import heapq
import sys
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for ii in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2 or (y1 == y2 and x1 == x2):
		print(1)
		continue
	l = x2 - x1
	b = y2 - y1
	print(l * b + 1)


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
farr = [1]
ifa = []

def fact(x, mod=0):
	if mod:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr) % mod)
	else:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr))
	return farr[x]

def ifact(x, mod):
	global ifa
	ifa.append(pow(farr[-1], mod - 2, mod))
	for i in range(x, 0, -1):
		ifa.append(ifa[-1] * i % mod)
	ifa = ifa[::-1]

def per(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return fact(i) // fact(i - j)
	return farr[i] * ifa[i - j] % mod

def com(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return per(i, j) // fact(j)
	return per(i, j, mod) * ifa[j] % mod

def catalan(n):
	return com(2 * n, n) // (n + 1)

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def lowbit(n):
	return n & -n

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class DSU:

	def __init__(self, n):
		self.c = [-1] * n

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def find(self, x):
		if self.c[x] < 0:
			return x
		self.c[x] = self.find(self.c[x])
		return self.c[x]

	def union(self, u, v):
		(u, v) = (self.find(u), self.find(v))
		if u == v:
			return False
		if self.c[u] < self.c[v]:
			(u, v) = (v, u)
		self.c[u] += self.c[v]
		self.c[v] = u
		return True

	def size(self, x):
		return -self.c[self.find(x)]

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return flag

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		for v in graph[u]:
			if v not in d or d[v] > d[u] + graph[u][v]:
				d[v] = d[u] + graph[u][v]
				heappush(heap, (d[v], v))
	return d

def GP(it):
	return [[ch, len(list(g))] for (ch, g) in groupby(it)]

class DLN:

	def __init__(self, val):
		self.val = val
		self.pre = None
		self.next = None

def nb(i, j):
	for (ni, nj) in [[i + 1, j], [i - 1, j], [i, j - 1], [i, j + 1]]:
		if 0 <= ni < n and 0 <= nj < m:
			yield (ni, nj)

@bootstrap
def gdfs(r, p):
	if len(g[r]) == 1 and p != -1:
		yield None
	for ch in g[r]:
		if ch != p:
			yield gdfs(ch, r)
	yield None
t = N()
for i in range(t):
	(x, y, x2, y2) = RL()
	ans = 1 + (x2 - x) * (y2 - y)
	print(ans)


import bisect
import sys
input = sys.stdin.readline
from collections import defaultdict

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def solve(case):
	[x1, y1, x2, y2] = inlt()
	return (y2 - y1) * (x2 - x1) + 1
T = inp()
for i in range(T):
	res = solve(i + 1)
	print(str(res))


for i in range(int(input())):
	(x, y, n, m) = map(int, input().split())
	n = abs(x - n)
	m = abs(y - m)
	l = min(n, m)
	t = max(n, m)
	ans = l * (l + 1)
	ans += l * (t - l)
	ans -= l
	print(ans + 1)


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if c < a or d < b:
		print(0)
	elif c == a or d == b:
		print(1)
	else:
		ans = (d - b) * (c - a) + 1
		print(ans)


t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	if a == c or b == d:
		print(1)
		continue
	mi = (c - a) * (c - a + 1) // 2
	st = c - a + (d - b)
	end = d - b + 1
	ma = (end + st) * (st - end + 1) // 2
	print(ma - mi + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	dif1 = abs(x2 - x1)
	dif2 = abs(y2 - y1)
	print(dif2 * dif1 + 1)


import sys
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	(a, b, m, n) = map(int, input().split())
	print((a - m) * (b - n) + 1)


for i in range(int(input())):
	(x, y, x2, y2) = map(int, input().split())
	del_x = abs(x - x2)
	del_y = abs(y - y2)
	a = min(del_x, del_y)
	b = max(del_x, del_y)
	ans = (2 + a - 1) * a + a * (b - a - 1) + 1
	if x == x2 or y == y2:
		ans = 1
	print(ans)


n = int(input())
for y in range(n):
	(a, b, c, d) = map(int, input().split())
	r = c - a
	d = d - b
	ans = r * d + 1
	print(ans)


def qtdCam(x1, x2, y1, y2):
	if x1 == y1 or x2 == y2:
		return 1
	aux = qtdCam(x1 + 1, x2, y1, y2)
	return aux + qtdCam(x1, x2 + 1, y1, y2)
qtd = int(input())
ret = 0
for i in range(qtd):
	let = input().split()
	x1 = let[0]
	x2 = let[1]
	y1 = let[2]
	y2 = let[3]
	a = (int(y1) - int(x1)) * (int(y2) - int(x2)) + 1
	print(a)


test_case = int(input())
while test_case:
	(x1, y1, x2, y2) = input().split()
	n = int(x2) - int(x1)
	m = int(y2) - int(y1)
	print(n * m + 1)
	test_case -= 1


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	delta_x = x2 - x1
	delta_y = y2 - y1
	if min(delta_x, delta_y) == 0:
		print(1)
	else:
		print(min(delta_x, delta_y) * max(delta_x, delta_y) + 1)


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
for _ in range(int(cin())):
	(a, b, x, y) = map(int, cin().split())
	if a == x or b == y:
		cout('1\n')
		continue
	mini = min(x - a, y - b)
	ans = mini * (mini + 1) + (x - a + y - b + 1 - mini * 2 - 2) * mini
	cout(str(ans + 1) + '\n')


for _ in range(int(input())):
	(x, y, x1, y1) = map(int, input().split())
	print((x - x1) * (y - y1) + 1)


def solve():
	(x1, y1, x2, y2) = map(int, input().split())
	n = x2 - x1
	m = y2 - y1
	if m == 0 or n == 0:
		print(1)
		return
	if n == m:
		print(m * (m + 1) - m + 1)
		return
	(n, m) = (max(m, n), min(m, n))
	print(m * (m + 1) - m + m * (n - m) + 1)
t = int(input())
for _ in range(t):
	solve()


def column(i, j):
	ans = i * (i + 1) * (2 * i + 1) // 6 + (2 * j - 1) * (i * (i + 1)) // 2 + i * (j - 1) * (j - 2)
	return ans // 2

def row(i, j):
	ans = j * (j + 1) * (2 * j + 1) // 6 + (2 * i - 3) * (j * (j + 1)) // 2 + j * (i - 1) * (i - 2)
	ans = ans // 2
	ans += j * i
	return ans

def cell_value(i, j):
	ans = (i + j - 1) * (i + j - 2) // 2 + i
	return ans

def solve():
	(x1, y1, x2, y2) = map(int, input().split())
	sum1 = column(x2, y1) - column(x1 - 1, y1) + row(x2, y2) - row(x2, y1 - 1) - cell_value(x2, y1)
	sum2 = column(x2, y2) - column(x1 - 1, y2) + row(x1, y2) - row(x1, y1 - 1) - cell_value(x1, y2)
	print(sum1 - sum2 + 1)
t = int(input())
while t > 0:
	t -= 1
	solve()


def x(n, a, b):
	return a + n * (n - 1) // 2 + (n - 1) * b

def sumx(n, a, b):
	return a * n + (n * (n + 1) * (2 * n + 1) // 6 - n * (n + 1) // 2) // 2 + b * n * (n + 1) // 2 - b * n
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	x2 -= x1
	y2 -= y1
	(x1, y1) = (0, 0)
	a = 0
	a += sumx(x2 + 1, 1, 0)
	a += sumx(y2 + 1, x(x2 + 1, 1, 0), x2 + 1)
	a -= x(x2 + 1, 1, 0)
	b = 0
	b += sumx(y2 + 1, 1, 1)
	b += sumx(x2 + 1, x(y2 + 1, 1, 1), y2)
	b -= x(y2 + 1, 1, 1)
	print(b - a + 1)


def main():
	t = int(input())
	for _ in range(t):
		(x1, y1, x2, y2) = map(int, input().split())
		print((x2 - x1) * (y2 - y1) + 1)
	return
main()


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	print((c - a) * (d - b) + 1)


t = int(input())

def numberOfPaths(m, n):
	return m * n - (m + n - 2)
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	print(numberOfPaths(c - a + 1, d - b + 1))


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	dispx = abs(a - c)
	dispy = abs(b - d)
	ans = dispx * dispy
	print(ans + 1)


import sys
import math

def I():
	return int(sys.stdin.readline())

def IL():
	return list(map(int, sys.stdin.readline().strip().split()))

def ILS():
	return list(map(str, sys.stdin.readline().strip().split()))
t = I()
for iii in range(t):
	(x1, y1, x2, y2) = IL()
	x = x2 - x1
	y = y2 - y1
	ans = x * y + 1
	print(ans)
	pass


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(x1, y1, x2, y2) = MAP()
	cntx = x2 - x1
	cnty = y2 - y1
	ans = cntx * cnty + 1
	print(ans)


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	x_d = x2 - x1
	y_d = y2 - y1
	if x_d == 0 or y_d == 0:
		print(1)
	elif x_d == 1 and y_d == 1:
		print(2)
	elif x_d == y_d:
		print(x_d * x_d + 1)
	else:
		r = min(x_d, y_d)
		print(r * (r + 1) + (x_d + y_d - 1 - r * 2) * r + 1)


testCases = int(input())
for t in range(testCases):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	print((x2 - x1) * (y2 - y1) + 1)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	s = list(s[:len(s)])
	if s[-1] == '\n':
		del s[-1]
	return s

def invr():
	return map(int, input().split())

def f(points):
	(x1, y1, x2, y2) = points
	return (x2 - x1) * (y2 - y1) + 1
t = inp()
result = []
for i in range(t):
	points = inlt()
	result.append(f(points))
for i in range(t):
	print(result[i])


t = int(input())
for _ in range(t):
	(x, y, x2, y2) = list(map(int, input().split()))
	print((y2 - y) * (x2 - x) + 1)


import sys
import math
readline = sys.stdin.readline
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))

def solve():
	(x1, y1, x2, y2) = nm()
	(n, m) = (x2 - x1, y2 - y1)
	print(n * m + 1)
t = ni()
for _ in range(t):
	solve()


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
total_answer = ''
for _ in range(int(f_input())):
	(x1, y1, x2, y2) = map(int, f_input().split())
	total_answer += str((x2 - x1) * (y2 - y1) + 1) + '\n'
f_print(total_answer)


def calc(a, r, n):
	return (a * n + (n - 1) * n * (n + 3 * r - 2) // 6, a + n * r + n * (n - 1) // 2)
t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	a = x1 + y1 - 1
	p1 = calc(0, a, x2 - x1)
	res1 = p1[0] + calc(p1[1], a + x2 - x1 + 1, y2 - y1)[0]
	p2 = calc(0, a + 1, y2 - y1)
	res2 = p2[0] + calc(p2[1], a + y2 - y1, x2 - x1)[0]
	print(res2 - res1 + 1)


def countPaths(n, m):
	if n == 0 or m == 0:
		return 1
	return countPaths(n - 1, m) + countPaths(n, m - 1)
for i in range(int(input())):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	if x1 == x2 and y2 - y1 >= 0:
		print(1)
	elif y1 == y2 and x2 - x1 >= 0:
		print(1)
	else:
		x = abs(x2 - x1)
		y = abs(y2 - y1)
		print(1 + x * y)


import math
t = int(input())
while t > 0:
	(a, b, c, d) = map(int, input().split())
	print(1 + (d - b) * (c - a))
	t -= 1


for q in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	x = abs(x2 - x1)
	y = abs(y2 - y1)
	if x > y:
		(x, y) = (y, x)
	print(x * y + 1)


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, stdin.readline().strip().split())
	print((x2 - x1) * (y2 - y1) + 1)


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(X1, Y1, X2, Y2) = [int(x) for x in input().split()]
		if X1 == X2:
			print(1)
			continue
		if Y1 == Y2:
			print(1)
			continue
		if X2 - X1 == 1:
			print(Y2 - Y1 + 1)
			continue
		if Y2 - Y1 == 1:
			print(X2 - X1 + 1)
			continue
		print((X2 - X1) * (Y2 - Y1) + 1)
main()


T = input()
T = int(T)
for i in range(T):
	(a, b, c, d) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	c = c - a
	d = d - b
	a = (2 + c) * (c + 1) // 2
	b = (1 + d) * d // 2 + 1
	a1 = (a - 1 + (a - 1 + c * d)) * d // 2
	b1 = (b - 1 + (b - 1 + c * d)) * c // 2
	if a1 > b1:
		print(a1 - b1 + 1)
	else:
		print(b1 - a1 + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = list(map(lambda x: int(x), input().split()))
	m = x2 - x1 + 1
	n = y2 - y1 + 1
	print((m - 1) * (n - 1) + 1)


import math
t = int(input())
while t:
	t -= 1
	a = list(map(int, input().split()))
	ans = (a[2] - a[0]) * (a[3] - a[1]) + 1
	print(ans)


T = int(input().strip())
for case_ in range(1, T + 1):
	(x1, y1, x2, y2) = map(int, input().strip().split())
	print((x2 - x1) * (y2 - y1) + 1)


import sys
from os import path
if path.exists('C:/Users/prana/Desktop/sublime/input.txt'):
	sys.stdin = open('C:/Users/prana/Desktop/sublime/input.txt', 'r')
	sys.stdout = open('C:/Users/prana/Desktop/sublime/output.txt', 'w')

def solve():
	(x1, y1, x2, y2) = input().split()
	x1 = int(x1)
	x2 = int(x2)
	y1 = int(y1)
	y2 = int(y2)
	print((x2 - x1) * (y2 - y1) + 1)
T = 1
T = int(input())
for _ in range(1, T + 1):
	print('Case #', _, file=sys.stderr)
	solve()


def A(a):
	return a * (a + 1) * (a + 2) / 6

def B(a, b):
	if b == 0:
		return 0
	return A(a + b - 1) - A(a - 1) - b * (a - 1)

def C(a):
	return a * (a * a + 5) / 6

def D(a, b):
	if a == 0:
		return 0
	return C(a + b - 1) - C(b - 1) + a * (b - 1)

def poiX(x, a, b):
	if a > b:
		return 0
	return B(x, b) - B(x, a - 1)

def poiY(y, a, b):
	if a > b:
		return 0
	return D(b, y) - D(a - 1, y)
t = int(input())
while t > 0:
	(x1, y1, x2, y2) = tuple(input().split())
	x1 = int(x1)
	y1 = int(y1)
	x2 = int(x2)
	y2 = int(y2)
	print(int(x2 - x1) * (y2 - y1) + 1)
	t = t - 1


for yt in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a == c or b == d:
		print(1)
	else:
		print((c - a) * (d - b) + 1)


import math
from collections import *

def query():
	pass

def solve(x1, y1, x2, y2):
	return (y2 - y1) * (x2 - x1) + 1
t = int(input())
for test_num in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	output_string = solve(x1, y1, x2, y2)
	print('{}'.format(output_string))


for _ in range(int(input())):
	s = input().split(' ')
	for i in range(4):
		s[i] = int(s[i])
	print((s[2] - s[0]) * (s[3] - s[1]) + 1)


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	n = y2 - y1
	m = x2 - x1
	if n < m:
		(n, m) = (m, n)
	if m == 0:
		print(1)
		continue
	print((1 + m) * m + m * (n - m - 1) + 1)


import functools
import sys
line = input()
nb_tests = int(line)
for i in range(nb_tests):
	line = input()
	tokens = line.split()
	(r_0, c_0, r_1, c_1) = (int(tokens[0]), int(tokens[1]), int(tokens[2]), int(tokens[3]))
	r_0 -= 1
	c_0 -= 1
	r_1 -= 1
	c_1 -= 1
	print((r_1 - r_0) * (c_1 - c_0) + 1)


def solve():
	(x1, y1, x2, y2) = map(int, input().split())
	print(abs((x2 - x1) * (y2 - y1)) + 1)
t = int(input())
for _ in range(t):
	solve()


import sys
import math

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(x1, y1, x2, y2) = get_ints()
	print((x2 - x1) * (y2 - y1) + 1)


def solve():
	n = int(input(''))
	for k in range(n):
		(i1, j1, i2, j2) = map(int, input('').split())
		di = abs(i1 - i2)
		dj = abs(j1 - j2)
		res = 1 + di * dj
		print(res)
solve()


t = int(input())
for i in range(0, t):
	s = input()
	gran1 = []
	gran = s.split(' ')
	for x in gran:
		y = int(x)
		gran1.append(y)
	print((gran1[2] - gran1[0]) * (gran1[3] - gran1[1]) + 1)


import math
t = int(input())
while t != 0:
	(x1, y1, x2, y2) = map(int, input().split())
	right = x2 - x1
	down = y2 - y1
	print(right * down + 1)
	t -= 1


t = int(input())
for it in range(t):
	(x1, y1, x2, y2) = [int(i) for i in input().split()]
	dx = x2 - x1
	dy = y2 - y1
	s = dx * (dx + 1) // 2
	s_ = (dy + 2) * (dy + 1) // 2 - 1
	ans = -(s + s + dy * dx) * (dy + 1) // 2
	ans += (s_ + s_ + dy * dx) * (dx + 1) // 2
	print(ans + 1 - (s_ - s))


T = int(input())
for _ in range(T):
	(r1, c1, r2, c2) = map(int, input().split())
	(dr, dc) = (r2 - r1, c2 - c1)
	print(dc * dr + 1)


import sys
input = lambda : sys.stdin.readline().strip()
for _ in range(int(input())):
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	print(1 + (x2 - x1) * (y2 - y1))


def triangle_zero(n):
	return n * (n - 1) // 2
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = [int(i) for i in input().split()]
	w = x2 - x1
	h = y2 - y1
	low = min(w, h) + 1
	high = max(w, h) + 1
	print(2 * triangle_zero(low) + (low - 1) * (high - low - 1) + 1)


for _ in range(int(input())):
	l = list(input().split(' '))
	for i in range(len(l)):
		l[i] = int(l[i])
	n = abs(l[0] - l[2])
	m = abs(l[1] - l[3])
	print(n * m + 1)


n = int(input())
for i in range(0, n):
	x = list(map(int, input().split()))
	y = (x[2] - x[0]) * (x[3] - x[1])
	print(y + 1)


import math
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	t1 = abs(x1 - x2)
	t2 = abs(y1 - y2)
	print(t1 * t2 + 1)


def row(n):
	if n == 0:
		return 0
	return (n * (n + 1) * (2 * n + 1) // 6 + n * (n + 1) // 2) // 2

def col(n):
	if n == 0:
		return 0
	return row(n - 1) + n

def main():
	T = int(input())
	while T:
		T -= 1
		(x1, y1, x2, y2) = map(int, input().split(' '))
		sum1 = col(y2 + x1 - 1) - col(y1 + x1 - 1 - 1) + (x1 - 1) * (y2 - y1 + 1) + row(x2 + y2 - 1) - row(x1 + y2 - 1) - (y2 - 1) * (x2 - x1)
		sum2 = col(y2 + x2 - 1) - col(y1 + x2 - 1 - 1) + (x2 - 1) * (y2 - y1 + 1) + row(x2 + y1 - 1 - 1) - row(x1 + y1 - 1 - 1) - (y1 - 1) * (x2 - x1)
		print(int(sum2 - sum1 + 1))
main()


import sys
from collections import defaultdict as dd
import heapq
import math
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	k = min(c - a, d - b)
	r = c - a + d - b - 1
	t = k * (k + 1)
	if 2 * k > r:
		print(t - k + 1)
	else:
		print(t + (r - 2 * k) * k + 1)


I = input
t = int(I())
while t > 0:
	t -= 1
	(x1, y1, x2, y2) = [int(x) for x in I().strip().split()]
	print((x2 - x1) * (y2 - y1) + 1)


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	(x1, y1, x2, y2) = map(int, input().split())
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans)
t = int(input())
for _ in range(t):
	main()


t = int(input())
for j in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		so = (x2 - x1) * (y2 - y1) + 1
		print(so)


tc = int(input())
while tc > 0:
	(x1, y1, x2, y2) = map(int, input().split())
	dx = x2 - x1
	dy = y2 - y1
	dmax = min(dx, dy)
	ans = dmax * dmax + abs(dx - dy) * dmax + 1
	print(ans)
	tc -= 1


def main():
	for q in range(int(input())):
		(x, y, x1, y1) = map(int, input().split())
		print((y1 - y) * (x1 - x) + 1)
main()


def go():
	(x1, y1, x2, y2) = map(int, input().split())
	return 1 + (x2 - x1) * (y2 - y1)
t = int(input())
ans = []
for _ in range(t):
	ans.append(str(go()))
print('\n'.join(ans))


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		x2 -= x1
		y2 -= y1
		print(abs(x2) * abs(y2) + 1)


def solution(a: int, b: int) -> int:
	return a * b + 1
t = int(input())
while t > 0:
	(a, b, c, d) = map(int, input().strip().split())
	print(solution(d - b, c - a))
	t -= 1


from sys import stdin, stdout
import sys
from math import *
input = stdin.readline
for __ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	print((a - x) * (b - y) + 1)


cases = int(input())
for t in range(cases):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	dx = x2 - x1
	dy = y2 - y1
	print(dx * dy + 1)


import sys
t = int(input())
while t:
	(xi, yi, xf, yf) = map(int, input().split())
	print((xf - xi) * (yf - yi) + 1)
	t -= 1


def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
t = ii()

def points(x, y):
	return y * (y - 1) // 2 + 1 + y * (x - 1) + (x - 1) * x // 2

def sq(y):
	return y * (y + 1) * (2 * y + 1) // 6

def sum(y):
	return y * (y + 1) // 2

def sumY(x, y2):
	ans = y2 + (x - 1) * x * y2 // 2 + (x - 1) * sum(y2)
	ans += (sq(y2) - sum(y2)) // 2
	return ans

def sumX(x2, y):
	ans = sum(y - 1) * x2
	ans += x2
	ans += y * (sum(x2) - x2)
	ans += (sq(x2) - sum(x2)) // 2
	return ans

def sumXRange(x1, x2, y):
	return sumX(x2, y) - sumX(x1 - 1, y) + 1

def sumYRange(x, y1, y2):
	return sumY(x, y2) - sumY(x, y1 - 1)
for _ in range(t):
	(x1, y1, x2, y2) = mi()
	P1 = points(x1, y1)
	P2 = points(x1, y2)
	P3 = points(x2, y1)
	P4 = points(x2, y2)
	sum1 = sumY(x1, y2) - sumY(x1, y1 - 1) - P2 + sumX(x2, y2) - sumX(x1 - 1, y2)
	sum2 = sumY(x2, y2) - sumY(x2, y1 - 1) - P3 + sumX(x2, y1) - sumX(x1 - 1, y1)
	print(sum2 - sum1 + 1)


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())
t = int(input())
for T in range(t):
	(r1, c1, r2, c2) = get_ints()
	print(abs(r1 - r2) * abs(c1 - c2) + 1)


t = int(input())
for you in range(t):
	l = input().split()
	x1 = int(l[0])
	y1 = int(l[1])
	x2 = int(l[2])
	y2 = int(l[3])
	s1 = x2 - x1
	s2 = y2 - y1
	l = s1 + s2 + 1
	a = min(s1, s2)
	b = max(s1, s2)
	r = 0
	r += a * (a + 1) // 2
	r += (a + 1) * (a + 2) // 2
	r += (a + 1) * (b - a)
	print(r - l + 1)


try:
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		x_di = abs(x2 - x1)
		y_di = abs(y2 - y1)
		print(x_di * y_di + 1)
except:
	pass


from fractions import Fraction
import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = 1
t = iinput()

def printNcR(n, r):
	p = 1
	k = 1
	if n - r < r:
		r = n - r
	if r != 0:
		while r:
			p *= n
			k *= r
			m = math.gcd(p, k)
			p //= m
			k //= m
			n -= 1
			r -= 1
	else:
		p = 1
	return p
for _ in range(t):
	(x1, y1, x2, y2) = rinput()
	a = x2 - x1
	b = y2 - y1
	print(a * b + 1)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(x1, y1, x2, y2) = value()
	n = x2 - x1
	m = y2 - y1
	print(n * m + 1)


t = int(input())
for case in range(t):
	[x1, y1, x2, y2] = list(map(int, input().split()))
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans)


import math
inp = lambda : map(int, input().split())
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = inp()
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		print(abs(x2 - x1) * abs(y2 - y1) + 1)


import math
t = int(input())
for x in range(t):
	[x1, y1, x2, y2] = list(map(int, input().split()))
	print((x2 - x1) * (y2 - y1) + 1)


import sys

class Scanner:

	def __init__(self):
		self.tokens = self.get_tokens()
		self.next_token = self.tokens.__next__

	def get_tokens(self):
		yield from (x.decode('ascii') for x in sys.stdin.buffer.read().split())

def get_ap_sum(a, d, n):
	x = 2 * a + (n - 1) * d
	return x * n >> 1

def get_first_row_sum(n):
	return n * (n * n + 5) // 6

def get_row_sum(r, n):
	a = (r * (r + 1) >> 1) - 1
	d = r - 1
	return get_first_row_sum(n) + get_ap_sum(a, d, n)

def get_first_col_sum(n):
	return n * (n + 1) * (n + 2) // 6

def get_col_sum(c, n):
	a = c * (c - 1) >> 1
	d = c - 1
	return get_first_col_sum(n) + get_ap_sum(a, d, n)

def solve(x1, y1, x2, y2):
	v1 = get_row_sum(x1, y2) - get_row_sum(x1, y1 - 1) + get_col_sum(y2, x2) - get_col_sum(y2, x1)
	v2 = get_col_sum(y1, x2) - get_col_sum(y1, x1 - 1) + get_row_sum(x2, y2) - get_row_sum(x2, y1)
	return abs(v1 - v2) + 1

def main(args):
	sc = Scanner()
	out = []
	t = int(sc.next_token())
	for _ in range(t):
		x1 = int(sc.next_token())
		y1 = int(sc.next_token())
		x2 = int(sc.next_token())
		y2 = int(sc.next_token())
		out.append(solve(x1, y1, x2, y2))
	print('\n'.join((str(x) for x in out)))
sys.exit(main(sys.argv))


from sys import stdin, stdout
(input, print) = (stdin.readline, stdout.write)

def main():
	for q in range(int(input())):
		(x, y, x1, y1) = map(int, input().split())
		print(str((y1 - y) * (x1 - x) + 1))
		print('\n')
main()


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 and y1 == y2:
		print(1)
	else:
		ans = 1
		value = (x2 - x1) * (y2 - y1)
		print(ans + value)


import collections, heapq, itertools, math, functools
groupby = itertools.groupby
rs = lambda : input()
ri = lambda : int(input())
rm = lambda : map(int, input().split())
rai = lambda : [int(x) for x in input().split()]

def solve():
	return (x2 - x1) * (y2 - y1) + 1
for t in range(ri()):
	(x1, y1, x2, y2) = rm()
	print(solve())


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def solve():
	(a, b, c, d) = li()
	print(abs(a - c) * abs(b - d) + 1)
for _ in range(I()):
	solve()


for I in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	result = (c - a) * (d - b) + 1
	print(result)


def dfs(x1, y1, x2, y2):
	if x1 == x2 and y1 == y2:
		return 1
	if x1 == x2 and y1 < y2:
		return 1
	elif x1 < x2 and y1 == y2:
		return 1
	return 1 + dfs(x1 + 1, y1, x2, y2) + (1 + dfs(x1, y1 + 1, x2, y2))
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans)


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	(a, b) = (x2 - x1 + 1, y2 - y1 + 1)
	if a > b:
		(a, b) = (b, a)
	print((a - 2) * (a - 1) + (a - 1) + (a - 1) * (b - a) + 1)


import sys
from collections import deque, defaultdict
from math import sqrt, factorial

def input():
	return sys.stdin.readline()[:-1]

def solve():
	(a, b, x, y) = [int(x) for x in input().split()]
	a = x - a
	b = y - b
	if a == 0 or b == 0:
		print(1)
	else:
		print(a * b + 1)
t = 1
t = int(input())
for case in range(1, t + 1):
	ans = solve()


for case in range(int(input())):
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans)


t = int(input())
for _ in range(t):
	(x1, q1, x2, q2) = [int(i) for i in input().split()]
	x2 -= x1
	q2 -= q1
	print(1 + x2 * q2)


from sys import stdin, stdout
input = lambda : stdin.readline().strip()
fast_print = stdout.write
from math import sqrt, floor
from bisect import bisect_right
T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	m = x2 - x1 + 1
	n = y2 - y1 + 1
	fast_print(str((m - 1) * (n - 1) + 1) + '\n')


for i in range(int(input())):
	(x, y, z, t) = map(int, input().split())
	print(1 + (z - x) * (t - y))


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	mina = min(abs(x1 - x2), abs(y1 - y2))
	maxa = max(abs(x1 - x2), abs(y1 - y2))
	ans1 = mina * (mina + 1) // 2
	ans2 = (maxa - mina) * mina
	ans3 = (mina - 1) * mina // 2
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		sys.stdout.write(str(ans1 + ans2 + ans3 + 1) + '\n')


from sys import stdin
from collections import Counter, deque
input = stdin.buffer.readline
T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(x, y, u, v) = map(int, input().split())
	a = (v - y) * (u - x)
	print(a + 1)


from sys import stdin, stdout
import math
fastinput = stdin.buffer.readline
for _ in range(int(fastinput())):
	(x1, y1, x2, y2) = map(int, fastinput().split())
	n = x2 - x1 + 1
	m = y2 - y1 + 1
	if n == 1 or m == 1:
		print(1)
	else:
		print(n * m - m - n + 2)


import sys
input = lambda : sys.stdin.readline().rstrip()
T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


import math as m
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	a = abs(x1 - x2)
	b = abs(y2 - y1)
	ans = a * b + 1
	print(ans)


for _ in range(int(input())):
	(fx, fy, sx, sy) = map(int, input().split())
	if fx == sx or fy == sy:
		print(1)
	else:
		ans = abs(fx - sx) * abs(fy - sy) + 1
		print(ans)


tc = int(input())

def solve(m, n):
	return m * n + 1
for _ in range(tc):
	(x1, y1, x2, y2) = map(int, input().split())
	(m, n) = (x2 - x1, y2 - y1)
	print(solve(m, n))


import sys
input = sys.stdin.readline

def main():
	test = int(input())
	for _ in range(test):
		(x1, y1, x2, y2) = map(int, input().split())
		ans = (x2 - x1) * (y2 - y1) + 1
		print(ans)
main()


def get_val(x, y):
	return x * (x + 1) // 2 + (y - 1) * (y - 2) // 2 + x * (y - 1)

def calc(a, d, n):
	if n == 0:
		return 0
	return a * n + d * (n - 1) * n // 2 + (n - 2) * (n - 1) * n // 6

def solve():
	(x1, y1, x2, y2) = map(int, input().split())
	d1 = get_val(x1, y1 + 1) - get_val(x1, y1)
	d2 = get_val(x1 + 1, y2) - get_val(x1, y2)
	s_min = calc(get_val(x1, y1), d1, y2 - y1) + calc(get_val(x1, y2), d2, x2 - x1 + 1)
	d3 = get_val(x1 + 1, y1) - get_val(x1, y1)
	d4 = get_val(x2, y1 + 1) - get_val(x2, y1)
	s_max = calc(get_val(x1, y1), d3, x2 - x1) + calc(get_val(x2, y1), d4, y2 - y1 + 1)
	print(s_max - s_min + 1)

def main():
	T = int(input())
	for i in range(T):
		solve()
main()


T = int(input())
while T != 0:
	T -= 1
	(a, b, x, y) = map(int, input().split())
	c = x - a + 1
	d = y - b + 1
	d1 = a + b - 1
	r1 = d1 + (y - b) - 1
	v1 = (d1 + r1) * (y - b) // 2 + a + y
	s1 = v1 * (c - 1) + (c - 1) * (c - 2) * d // 2
	d2 = a + b
	r2 = d2 + (x - a) - 1
	v2 = (d2 + r2) * (x - a) // 2
	s2 = v2 * d + d * (d - 1) * (c - 1) // 2
	print(s2 - s1 + 1)


for t in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	rows = x2 - x1
	cols = y2 - y1 + 1
	print(cols * rows - rows + 1)


for t in range(int(input())):
	(n, m, a, b) = map(int, input().split())
	print((a - n) * (b - m) + 1)


from sys import stdin
import math
a = int(stdin.readline())
for b in range(0, a):
	A = stdin.readline().split()
	X1 = int(A[0])
	Y1 = int(A[1])
	X2 = int(A[2])
	Y2 = int(A[3])
	X2 = X2 - (X1 - 1)
	Y2 = Y2 - (Y1 - 1)
	print(1 + (X2 - 1) * (Y2 - 1))


try:
	t = int(input())
	while t:
		(x1, y1, x2, y2) = map(int, input().split())
		if x1 == x2 or y1 == y2:
			print('1')
		else:
			print((x2 - x1) * (y2 - y1) + 1)
		t -= 1
except:
	pass


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
cases = int(input())
for t in range(cases):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	dx = x2 - x1
	dy = y2 - y1
	print(dx * dy + 1)


def solve():
	maxi = max(x2 - x1, y2 - y1) + 1
	mini = min(x2 - x1, y2 - y1) + 1
	d = mini - 2
	ans = 2 * (d * (d + 1)) // 2 + (maxi - mini + 1) * max(mini - 1, 0) + 1
	print(ans)
	return
t = int(input())
for tt in range(1, t + 1):
	(x1, y1, x2, y2) = [int(i) for i in input().split(' ')]
	solve()


def sq_val(x, y):
	pt2 = (x + y - 2) * (x + y - 1) // 2 + x
	return pt2
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, stdin.readline().split())
	y = abs(y1 - y2)
	x = abs(x1 - x2)
	x = x * y + 1
	print(x)


t = int(input())
for _ in range(t):
	(x_1, y_1, x_2, y_2) = tuple([int(obj) for obj in input().split()])
	w = x_2 - x_1 + 1
	h = y_2 - y_1 + 1
	print((w - 1) * (h - 1) + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split(' ')))
	x = x2 - x1
	y = y2 - y1
	(x, y) = (y, x) if y > x else (x, y)
	maximum = y * (y + 1) - y + y * (x - y)
	print(int(maximum + 1))


import sys
import math
import operator as op
from functools import reduce
from collections import deque

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
	return [float(v) for v in sys.stdin.readline().split()]

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer / denom
t = read_int()
for i in range(t):
	(x1, y1, x2, y2) = read_int_line()
	l1 = abs(x1 - x2)
	l2 = abs(y1 - y2)
	ans = l1 * l2 + 1
	print(int(ans))


def colSum(x, y):
	res = (x + 1) * x * (x - 1) // 6
	res += x * (x + 1) * y // 2
	res += x * (y * (y - 1) // 2 - y + 1)
	return res

def rowSum(x, y):
	res = y * (x * (x - 1) // 2 + 1)
	res += (y + 1) * y * (y - 1) // 6
	res += (x - 1) * y * (y + 1) // 2
	return res

def main():
	t = int(input())
	for _ in range(t):
		(x1, y1, x2, y2) = map(int, input().split())
		left = rowSum(x1, y2) - rowSum(x1, y1 - 1) + colSum(x2, y2) - colSum(x1, y2)
		right = rowSum(x2, y2) - rowSum(x2, y1) + colSum(x2, y1) - colSum(x1 - 1, y1)
		res = right - left + 1
		print(res)
main()


def get_val(x, y):
	d = x + y - 2
	return d * (d + 1) // 2 + x

def get_h_sum(x1, y1, y2):
	d1 = x1 + y1 - 2
	d2 = x1 + y2 - 2
	s = 0
	s += (y2 - y1 + 1) * x1
	s += d2 * (d2 + 1) * (d2 + 2) // 6
	s -= (d1 - 1) * d1 * (d1 + 1) // 6
	return s

def get_v_sum(y1, x1, x2):
	d1 = x1 + y1 - 1
	d2 = x2 + y1 - 1
	s = 0
	s += d2 * (d2 + 1) * (d2 + 2) // 6
	s -= (d1 - 1) * d1 * (d1 + 1) // 6
	s -= (x2 - x1 + 1) * (y1 - 1)
	return s

def get_min(x1, y1, x2, y2):
	s = 0
	s += get_h_sum(x1, y1, y2 - 1)
	s += get_v_sum(y2, x1, x2 - 1)
	return s + get_val(x2, y2)

def get_max(x1, y1, x2, y2):
	s = 0
	s += get_v_sum(y1, x1, x2 - 1)
	s += get_h_sum(x2, y1, y2 - 1)
	return s + get_val(x2, y2)

def solve():
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	ans1 = get_min(x1, y1, x2, y2)
	ans2 = get_max(x1, y1, x2, y2)
	print(ans2 - ans1 + 1)
t = int(input())
for _ in range(t):
	solve()


import sys
input = sys.stdin.readline
for f in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


kl = int(input())
for l in range(kl):
	(x1, y1, x2, y2) = map(int, input().split())
	print(1 + (x2 - x1) * (y2 - y1))


def r(i, j):
	return i + j - 1

def d(i, j):
	return i + j

def shor(i, j, k, start):
	R = d(i, j)
	y = k - j
	x = R
	a = start * (k - j + 1)
	b = (k - j) * R * (R - 1) // 2
	c = y * (3 * x * x + 3 * x * y + y * y - 1) // 6
	return a - b + c

def sver(i, j, k, start):
	R = d(i, j)
	y = k - i
	x = R
	a = start * (k - i + 1)
	b = (k - i) * R * (R - 1) // 2
	c = y * (3 * x * x + 3 * x * y + y * y - 1) // 6
	return a - b + c

def mhor(i, j, k, start):
	k -= 1
	R = r(i, j)
	up = (R + k - j) * (R + k - j + 1) // 2
	down = R * (R - 1) // 2
	return start + up - down

def mver(i, j, k, start):
	k -= 1
	R = d(i, j)
	up = (R + k - i) * (R + k - i + 1) // 2
	down = R * (R - 1) // 2
	return start + up - down

def get_val(i, j):
	res = mhor(1, 1, j, 1)
	return mver(1, j, i, res)

def solve(x1, y1, x2, y2):
	tl = get_val(x1, y1)
	tr = get_val(x1, y2)
	bl = get_val(x2, y1)
	br = get_val(x2, y2)
	sumMin = shor(x1, y1, y2, tl) + sver(x1, y2, x2, tr) - tr
	sumMax = sver(x1, y1, x2, tl) + shor(x2, y1, y2, bl) - bl
	return sumMax - sumMin + 1
t = int(input())
for _ in range(t):
	parts = [int(x) for x in input().split()]
	[x1, y1, x2, y2] = parts
	print(solve(x1, y1, x2, y2))


import sys
readline = sys.stdin.readline
T = int(readline())
Ans = [None] * T
for qu in range(T):
	(h1, w1, h2, w2) = map(int, readline().split())
	Ans[qu] = 1 + (w2 - w1) * (h2 - h1)
print('\n'.join(map(str, Ans)))


def f(x, y):
	return (x + y - 1) * (x + y - 2) // 2 + x
T = int(input())
while T > 0:
	(x1, y1, x2, y2) = map(int, input().split())
	T -= 1
	ans = 0
	ans += (f(x1, y1) - f(x1, y2) + (f(x2, y1) - f(x2, y2))) * (x2 - x1 + 1) // 2
	ans += (f(x2, y1) - f(x1, y1) + (f(x2, y2) - f(x1, y2))) * (y2 - y1 + 1) // 2
	ans += f(x1, y2) - f(x2, y1)
	print(ans + 1)


import sys
from math import floor, sqrt, ceil, factorial, gcd, pi
from itertools import chain, combinations, permutations, accumulate
from collections import Counter, defaultdict, OrderedDict, deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -sys.maxsize - 1
mod = 1000000007

def solve():
	t = int(sys.stdin.readline())
	for _ in range(t):
		(x1, y1, x2, y2) = map(int, sys.stdin.readline().split())
		print((x2 - x1) * (y2 - y1) + 1)
solve()


import math
test_num = int(input())
values = []
for i in range(test_num):
	y = input()
	z = [int(x) for x in y.split(' ')]
	values.append(z)
for i in range(test_num):
	v = values[i]
	deno1 = abs(v[1] - v[3])
	deno2 = abs(v[0] - v[2])
	print(deno1 * deno2 + 1)


import sys
from math import sqrt
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for i in range(t):
	(x1, y1, x2, y2) = invr()
	no_D = x2 - x1
	no_R = y2 - y1
	res = no_D * no_R + 1
	print(res)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
for _ in range(ii()):
	(x1, y1, x2, y2) = mi()
	print((x2 - x1) * (y2 - y1) + 1)


T = int(input())
for t in range(T):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	res = (x2 - x1) * (y2 - y1) + 1
	print(res)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	a = x2 - x1 + 1
	b = y2 - y1 + 1
	u1 = (b + 1) * (b * b - b + 6) // 6 - 1
	d1 = (a + 1) * (a * a + 2 * a) // 6
	m1 = b * (b - 1) // 2 + 1
	m2 = a * (a - 1) // 2 + a
	u2 = (a - 1) * m1 + (d1 - m2) + b * a * (a - 1) // 2
	x = (b - 1) * ((b - 2) * (b - 2) + 2 * (b - 2)) // 6
	d2 = (b - 1) * m2 + x + a * b * (b - 1) // 2
	print(d1 + d2 - u1 - u2 + 1)


import os
import sys
import io
import math
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for t in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		answer = 1
	if x1 > x2 or y1 > y2:
		answer = 0
	else:
		print((x2 - x1) * (y2 - y1) + 1)


from sys import stdin, stdout

def solve():
	(x1, y1, x2, y2) = map(int, stdin.readline().split())
	x2 -= x1
	y2 -= y1
	return x2 * y2 + 1
for _ in range(int(stdin.readline())):
	stdout.write(str(solve()) + '\n')


for i in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	ch1 = x2 - x1
	ch2 = y2 - y1
	minn = ch2 * (ch2 + 1) // 2
	maxx = (ch2 + ch1) * (ch2 + ch1 + 1) // 2 - ch1 * (ch1 + 1) // 2
	print(maxx - minn + 1)


t = int(input())
while t > 0:
	a = list(map(int, input().split()))
	(x, y, a, b) = (a[0], a[1], a[2], a[3])
	p = a - x
	q = b - y
	t -= 1
	print(p * q + 1)


import sys, os, io, math, collections
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	print((c - a) * (d - b) + 1)


import sys
file_name = ''
if file_name:
	f = open(file_name, 'r')
else:
	f = sys.stdin
line = f.readline()
t = int(line)
for _ in range(t):
	(x1, y1, x2, y2) = [int(x) for x in f.readline().split()]
	a = x2 - x1
	b = y2 - y1
	print(a * b + 1)


n = int(input())
for i in range(0, n):
	(a, b, c, d) = map(int, input().split())
	print((c - a) * (d - b) + 1)


import sys
input = sys.stdin.readline
t = int(input())
out = []
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	dX = c - a
	dY = d - b
	out.append(dX * dY + 1)
print('\n'.join(map(str, out)))


T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = input().split()
	(x1, y1, x2, y2) = (int(x1), int(y1), int(x2), int(y2))
	print(abs(x1 - x2) * abs(y1 - y2) + 1)


for ttt in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 > x2 or y1 > y2:
		print(0)
	else:
		x = x2 - x1
		y = y2 - y1
		ans = min(x, y) * (min(x, y) + 1) + (abs(x - y) - 1) * min(x, y)
		print(ans + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	dx = x2 - x1
	dy = y2 - y1
	if dx == 0 or dy == 0:
		print(1)
		continue
	if dx == 1 or dy == 1:
		print(dx * dy + 1)
		continue
	mi = min(dx, dy)
	diff = max(dx, dy) - mi + 1
	ans = mi * (mi - 1) // 2 * 2 + mi * diff + 1
	print(ans)


for _ in ' ' * int(input()):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 and y2 == y1:
		print(1)
	else:
		print((x2 - x1) * (y2 - y1) + 1)


t = int(input())
while t:
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	print((x2 - x1) * (y2 - y1) + 1)
	t -= 1


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	(a, b, c, d) = mapi()
	print((c - a) * (d - b) + 1)


def gs(x):
	return x * (x + 1) // 2

def get_sum(l, r):
	return gs(r) - gs(l - 1)
t = int(input())
while t > 0:
	t -= 1
	(x1, y1, x2, y2) = map(int, input().split())
	length = x2 - x1 + y2 - y1
	right = y2 - y1
	print(get_sum(length - right + 1, length) - get_sum(1, right) + 1)


import sys
import math
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for tt in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	x = c - a
	y = d - b
	print(x * y + 1)


T = int(input())
for t in range(T):
	(x1, y1, x2, y2) = [int(_) for _ in input().split()]
	(dd, DD) = (min(abs(x1 - x2), abs(y1 - y2)), max(abs(x1 - x2), abs(y1 - y2)))
	d = 0
	d += dd * (dd + 1)
	d += (DD - dd - 1) * dd
	print(d + 1)


import sys
input = sys.stdin.buffer.readline
import math

def solution():
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		print((x2 - x1) * (y2 - y1) + 1)
solution()


T = int(input())
for y in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
		continue
	else:
		print(abs(x1 - x2) * abs(y1 - y2) + 1)


t = int(input())
while t:
	t -= 1
	(x1, y1, x2, y2) = map(int, input().split())
	X = x2 - x1
	Y = y2 - y1
	print(X * Y + 1)


def solve():
	(x1, y1, x2, y2) = [int(v) for v in input().split()]
	if x1 == x2 or y1 == y2:
		print(1)
		return
	z = y2 - y1
	print(z * (x2 - x1) + 1)
t = int(input())
for _ in range(t):
	solve()


t = int(input())
while t > 0:
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		res = (x2 - x1) * (y2 - y1) + 1
		print(res)
	t -= 1


def main():
	T = int(input())
	while T > 0:
		(x1, y1, x2, y2) = map(int, input().split())
		print((x2 - x1) * (y2 - y1) + 1)
		T -= 1
main()


from math import ceil
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for _ in range(t):
	(x1, y1, x2, y2) = mInt()
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		if x1 > y1:
			(x1, y1) = (y1, x1)
			(x2, y2) = (y2, x2)
		print((y2 - y1) * (x2 - x1) + 1)


import sys
from math import sqrt, sin, cos, pi
from collections import defaultdict as dd, deque, Counter as C
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(x1, y1, x2, y2) = sp()
	out((x2 - x1) * (y2 - y1) + 1)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(x, y, a, b) = I()
	(n, m) = (a - x + 1, b - y + 1)
	print((n - 1) * (m - 1) + 1)


t = int(input())
from math import *
for ab in range(t):
	(x, y, z, w) = list(map(int, input().split()))
	print((z - x) * (w - y) + 1)


for _ in range(int(input())):
	(x1, y1, x2, y2) = [int(s) for s in input().split()]
	r = y2 - y1
	d = x2 - x1
	print(r * d + 1)


import math

def check(n, k):
	return n // 2 * k + math.ceil(k / 2) * (n % 2)

def solution():
	(x1, y1, x2, y2) = map(int, input().split())
	n = x2 - x1
	m = y2 - y1
	if min(n, m) == 0:
		print(1)
		return
	print(2 + (m - 1) + m * (n - 1))
for _ in range(int(input())):
	solution()


for _ in range(int(input())):
	(a, b, c, d) = [int(i) for i in input().split()]
	print((c - a) * (d - b) + 1)


number = int(input())
for iTask in range(number):
	inputStr = str(input())
	(x1, y1, x2, y2) = list(map(int, inputStr.split(' ')))
	dx = x2 - x1
	dy = y2 - y1
	print(dx * dy + 1)


def f(n):
	return n * (n + 1) // 2

def g(n):
	return n * (n + 1) * (n + 2) // 6

def calc(x, y):
	return f(x) + f(x + y - 2) - f(x - 1)
tests = int(input())
for _ in range(tests):
	(x1, y1, x2, y2) = map(int, input().split())
	x = calc(x1, y1)
	y = calc(x1, y2)
	sum_1 = x * (y2 - y1 + 1) + g(x1 + y2 - 2) - g(x1 + y1 - 3) - (y2 - y1 + 1) * f(x1 + y1 - 2)
	sum_1 += -y + y * (x2 - x1 + 1) + g(y2 + x2 - 1) - g(y2 + x1 - 2) - (x2 - x1 + 1) * f(y2 + x1 - 1)
	y = calc(x1, y1)
	x = calc(x2, y1)
	sum_2 = x * (y2 - y1 + 1) + g(x2 + y2 - 2) - g(x2 + y1 - 3) - (y2 - y1 + 1) * f(x2 + y1 - 2)
	sum_2 += -x + y * (x2 - x1 + 1) + g(y1 + x2 - 1) - g(y1 + x1 - 2) - (x2 - x1 + 1) * f(y1 + x1 - 1)
	print(sum_2 - sum_1 + 1)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	(xx, yy) = (x2 - x1, y2 - y1)
	print(xx * yy + 1)


t = int(input())
for q in range(t):
	mas = list(map(int, input().split()))
	x = mas[2] - mas[0]
	y = mas[3] - mas[1]
	print(1 + x * y)


for s in [*open(0)][1:]:
	(u, v, x, y) = map(int, s.split())
	print((x - u) * (y - v) + 1)


from itertools import product, combinations
from math import sqrt, gcd, ceil
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x1 - x2) * (y1 - y2) + 1)


def get_ap_sum(a0, d0, d, n):
	return a0 * n + d0 * n * (n - 1) // 2 + d * n * (n - 1) * (n - 2) // 6
t = int(input())
for _ in range(t):
	(r1, c1, r2, c2) = map(int, input().split())
	a1 = r1 + (r1 + c1 - 2) * (r1 + c1 - 1) // 2
	a2 = r1 + (r1 + c2 - 2) * (r1 + c2 - 1) // 2
	a3 = r2 + (r2 + c1 - 2) * (r2 + c1 - 1) // 2
	s1 = get_ap_sum(a1, r1 + c1 - 1, 1, c2 - c1 + 1)
	s2 = get_ap_sum(a2, r1 + c2, 1, r2 - r1 + 1)
	s3 = get_ap_sum(a1, r1 + c1, 1, r2 - r1 + 1)
	s4 = get_ap_sum(a3, r2 + c1 - 1, 1, c2 - c1 + 1)
	ma = s3 + s4 - a3
	mi = s1 + s2 - a2
	print(ma - mi + 1)


import sys
input = sys.stdin.buffer.readline

def print(val):
	sys.stdout.write(str(val) + '\n')
for _ in range(int(input())):
	(a, b, m, n) = [int(i) for i in input().split()]
	print((a - m) * (b - n) + 1)


t = int(input())
for i in range(t):
	a = input().split()
	print((int(a[2]) - int(a[0])) * (int(a[3]) - int(a[1])) + 1)


from queue import LifoQueue

def print_sol(c, sol):
	print('Case #{}: {}'.format(c, sol))

def rd_int():
	return int(input())

def rd_str():
	return input()

def rd_str_lst():
	return input().split(' ')

def sp_str_lst():
	return list(input())

def rd_int_lst():
	return [int(i) for i in rd_str_lst()]

def sp_int_lst():
	return [int(i) for i in sp_str_lst()]

def dfs(g, i, v):
	v[i] = True
	for j in g[i]:
		if not v[j]:
			dfs(g, j, v)
	print(i)

def dfs_iter(g, i, n):
	v = [False] * n
	stack = LifoQueue()
	stack.put(i)
	while stack.not_empty:
		u = stack.get()
		v[u] = True
		print(u)
		for i in g[u]:
			if not v[i]:
				stack.put(i)

def main():
	t = rd_int()
	for c in range(1, t + 1):
		(x1, y1, x2, y2) = rd_int_lst()
		sol = (y2 - y1) * (x2 - x1) + 1
		print(sol)
main()


from sys import stdin, stdout

def printtable(m, n):
	cell = [[0 for j in range(n)] for i in range(m)]
	cell[0][0] = 1
	for i in range(m):
		for j in range(n):
			if j > 0:
				cell[i][j] = cell[i][j - 1] + i + j
			elif i > 0:
				cell[i][j] = cell[i - 1][j] + i + 1
			stdout.write(str(cell[i][j]))
			stdout.write(' ')
		print(' ')

def celex_update(x1, y1, x2, y2):
	m = abs(x1 - x2) + 1
	n = abs(y1 - y2) + 1
	if m == 1 or n == 1:
		return 1
	r = m + n - 3
	a = min(m, n) - 1
	res = a * (a + 1) // 2
	if m == n:
		res += (a - 1) * a // 2
	else:
		res *= 2
		r -= 2 * a
		res += r * a
	return res + 1
t = int(stdin.readline())
for i in range(t):
	xy = list(map(int, stdin.readline().split()))
	stdout.write(str(celex_update(xy[0], xy[1], xy[2], xy[3])) + '\n')


import sys
input = lambda : sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline

def I():
	return list(map(int, inp().split()))
from collections import Counter
from math import factorial as fac

def comb(n, r, num=1, den=1):
	for i in range(1, r + 1):
		den *= i
	for i in range(n, n - r, -1):
		num *= i
	return num // den
for _ in range(I()[0]):
	(a, b, x, y) = I()
	n = abs(x - a)
	m = abs(y - b)
	z = min(n, m)
	ans = z * (z + 1)
	z1 = max(n, m)
	ans += (max(n, m) - 1 - min(n, m)) * min(n, m)
	print(ans + 1)


import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	e = c - a
	f = d - b
	print(e * f + 1)


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	m = abs(x2 - x1)
	n = abs(y2 - y1)
	print(m * n + 1)


import math
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	if a == c or b == d:
		print(1)
		continue
	if c < a:
		print(0)
		continue
	r = d - b + 1 + (d - b) * (c - a - 1)
	print(r)


testy = int(input())
import math
results = []
for i in range(testy):
	wejscie = list(map(int, input().split()))
	deltax = abs(wejscie[0] - wejscie[2])
	deltay = abs(wejscie[1] - wejscie[3])
	results.append(deltax * deltay + 1)
for result in results:
	print(result)


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	t1 = x2 - x1 + 1
	t2 = y2 - y1 + 1
	t = min(t1, t2)
	sum1n = lambda n: n * (n + 1) // 2
	k = t1 + t2 - 1 - t - t
	ans = sum1n(t) * 2 + k * t
	print(1 + ans - t1 - t2 + 1)


tt = int(input())
for loop in range(tt):
	(x1, y1, x2, y2) = map(int, input().split())
	print((y2 - y1) * (x2 - x1) + 1)


from math import factorial as F
T = int(input())
for i in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	if x2 < x1 or y2 < y1:
		print(0)
		continue
	n = x2 - x1
	m = y2 - y1
	print(n * m + 1)


import math
import random
import time
import datetime
import sys
get_char = lambda : sys.stdin.read(1)
get_line = input

def read_int():
	number: int = 0
	sign: int = 1
	ch = get_char()
	if ch == '-':
		sign = -1
		ch = get_char()
	while ch.isdigit():
		number = number * 10 + ord(ch) - ord('0')
		ch = get_char()
	return number * sign

def f(n):
	return n * (n + 1) // 2

def g(n):
	return n * (n + 1) * (n + 2) // 6

def calc(x, y):
	return f(x) + f(x + y - 2) - f(x - 1)
pi = math.pi
mod = 10 ** 9 + 7
eps = 10 ** (-9)
inf = 2 * 10 ** 18
maxn = 10 ** 6 + 10

def solution():
	x1 = read_int()
	y1 = read_int()
	x2 = read_int()
	y2 = read_int()
	x = calc(x1, y1)
	y = calc(x1, y2)
	sum_1 = x * (y2 - y1 + 1) + g(x1 + y2 - 2) - g(x1 + y1 - 3) - (y2 - y1 + 1) * f(x1 + y1 - 2)
	sum_1 += -y + y * (x2 - x1 + 1) + g(y2 + x2 - 1) - g(y2 + x1 - 2) - (x2 - x1 + 1) * f(y2 + x1 - 1)
	y = calc(x1, y1)
	x = calc(x2, y1)
	sum_2 = x * (y2 - y1 + 1) + g(x2 + y2 - 2) - g(x2 + y1 - 3) - (y2 - y1 + 1) * f(x2 + y1 - 2)
	sum_2 += -x + y * (x2 - x1 + 1) + g(y1 + x2 - 1) - g(y1 + x1 - 2) - (x2 - x1 + 1) * f(y1 + x1 - 1)
	print(sum_2 - sum_1 + 1)

def main():
	tests_count: int = 1
	tests_count = read_int()
	for test_case in range(tests_count):
		solution()
main()


from __future__ import division, print_function
import os, sys
import math
import collections
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r))

def binary_search(arr, low, high, x):
	if high >= low:
		mid = (high + low) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return binary_search(arr, low, mid - 1, x)
		else:
			return binary_search(arr, mid + 1, high, x)
	else:
		return -1

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def padded_bin_with_complement(x):
	if x < 0:
		return bin(2 ** 16 - abs(x))[2:].zfill(16)
	else:
		return bin(x)[2:].zfill(16)

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	print(decimal)

def CountFrequency(arr):
	return collections.Counter(arr)

def pos(a):
	b = [0] * len(a)
	c = sorted(a)
	for i in range(len(a)):
		for j in range(len(a)):
			if c[j] == a[i]:
				b[i] = j
				break
	return b

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n

def main():
	for _ in range(ii()):
		res = 0
		(x1, y1, x2, y2) = mi()
		if x1 == x2 or y1 == y2:
			print(1)
			continue
		else:
			print(abs(x1 - x2) * abs(y1 - y2) + 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin, stdout
t = int(stdin.readline())
while t > 0:
	(x1, y1, x2, y2) = map(int, stdin.readline().split())
	ans = (x2 - x1) * (y2 - y1) + 1
	stdout.write('{}\n'.format(ans))
	t -= 1


import sys
import math
input = sys.stdin.readline
import operator as op
from functools import reduce

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
for _ in range(inin()):
	(a, b, c, d) = cin()
	print((c - a) * (d - b) + 1)


import math
t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	(m, n) = (x2 - x1, y2 - y1)
	print(m * n + 1)


for _ in range(int(input())):
	(x, y, x2, y2) = map(int, input().split())
	a = x2 - x
	b = y2 - y
	print(a ** 2 + 1 + (b - a) * a)


q = int(input())
import sys
for i in range(q):
	(x1, y1, x2, y2) = [int(i) for i in sys.stdin.readline().split()]
	print((x2 - x1) * (y2 - y1) + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = [int(c) for c in input().split()]
	print((x2 - x1) * (y2 - y1) + 1)


from sys import stdin, stdout
import math
fastinput = stdin.buffer.readline
t = int(fastinput())
while t:
	t -= 1
	(x1, y1, x2, y2) = map(int, input().strip().split(' '))
	n = x2 - x1 + 1
	m = y2 - y1 + 1
	if n == 1 or m == 1:
		print(1)
	else:
		print(n * m - m - n + 2)


import math
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	ans = 0
	ans = min(c - a + 1, d - b + 1) * (min(c - a + 1, d - b + 1) - 1)
	ans -= min(c - a + 1, d - b + 1) - 1
	ans += (max(c - a + 1, d - b + 1) - min(c - a + 1, d - b + 1)) * (min(c - a + 1, d - b + 1) - 1)
	if a == c or b == d:
		ans = 0
	print(ans + 1)


def main():
	import sys
	input = sys.stdin.readline
	sys.setrecursionlimit(10 ** 6)
	t = int(input())
	for _ in range(t):
		(x1, y1, x2, y2) = [int(x) for x in input().strip().split()]
		(dx, dy) = (max(x2 - x1, y2 - y1), min(x2 - x1, y2 - y1))
		delta = dy * (dx - dy + 1) + (dy - 1) * dy
		print(delta + 1)
main()


ans = []
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	m = y2 - y1
	n = x2 - x1
	ans.append(n * m + 1)
for i in ans:
	print(i)


def prog():
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		x = abs(x2 - x1)
		y = abs(y2 - y1)
		a = min(x, y)
		b = max(x, y)
		ans = 1
		ans += a * (a - 1) + a
		ans += a * (b - a)
		print(ans)
prog()


t = int(input())
tests = []
for i in range(t):
	xy = [int(el) for el in input().split()]
	tests.append(xy)
for i in range(t):
	(x1, y1) = (tests[i][0], tests[i][1])
	(x2, y2) = (tests[i][2], tests[i][3])
	distX = x2 - x1
	distY = y2 - y1
	if distX == 0 or distY == 0:
		print(1)
	else:
		totalDPaths = distX * distY + 1
		print(totalDPaths)


def f(x):
	return (x ** 3 + 5 * x) // 6

def f1(r, a, b):
	return f(b + r - 1) - f(a + r - 1) + (r - 1) * (b - a)

def f2(c, a, b):
	return f(b + c) - f(a + c) - c * (b - a)
t = int(input())
for _ in range(t):
	(a, c, b, d) = map(int, input().split())
	p = f1(a, c - 1, d) + f2(d, a, b)
	q = f2(c, a - 1, b) + f1(b, c, d)
	print(q - p + 1)


def art_sum(N, d, a):
	return N * a + N * (N - 1) * (3 * d + N - 2) // 6

def art_find(N, d, a):
	return a + (N - 1) * d + (N - 2) * (N - 1) // 2

def art_diff(N, a):
	return a + (N - 1)

def C():
	(x1, y1, x2, y2) = map(int, input().split(' '))
	x2 = x2 - x1
	y2 = y2 - y1
	sum1 = art_sum(x2 + 1, 1, 1)
	num1 = art_find(x2 + 1, 1, 1)
	sum1 = sum1 + art_sum(y2 + 1, art_diff(x2 + 1, 2), num1) - num1
	sum2 = art_sum(y2 + 1, 2, 1)
	num2 = art_find(y2 + 1, 2, 1)
	sum2 = sum2 + art_sum(x2 + 1, art_diff(y2 + 1, 1), num2) - num2
	print(sum2 - sum1 + 1)
t = int(input())
for i in range(t):
	C()


from math import *
t = int(input())
while t:
	(x1, y1, x2, y2) = map(int, input().split())
	x = int(fabs(x1 - x2))
	y = int(fabs(y1 - y2))
	print(x * y + 1)
	t -= 1


for t in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	xx = x2 - x1
	yy = y2 - y1
	print(xx * yy + 1)


n = int(input())
for _ in range(n):
	(x, y, x1, y1) = map(int, input().split())
	if x == x1 or y == y1:
		print(1)
	else:
		print(abs(x - x1) * abs(y - y1) + 1)


from sys import stdin
for t in range(int(input())):
	(a, b, c, d) = map(int, stdin.readline().split())
	row = abs(a - c) + 1
	col = abs(b - d) + 1
	print(1 + (col - 1) * (row - 1))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

def main():
	for _ in range(N()):
		(x1, y1, x2, y2) = RL()
		r = x2 - x1
		l = y2 - y1
		print(r * l + 1)
main()


T = int(input().strip())
for t in range(T):
	(x0, y0, x1, y1) = list(map(int, input().split()))
	print((x1 - x0) * (y1 - y0) + 1)


def main():
	t = int(input())
	for i in range(t):
		(x1, y1, x2, y2) = map(int, input().split())
		if x1 == x2 and y1 == y2:
			print(1)
		else:
			print((x2 - x1) * (y2 - y1) + 1)
main()


import sys
input = sys.stdin.readline

def main():
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		w = x2 - x1 + 1
		h = y2 - y1 + 1
		min_n = min(w, h)
		max_n = max(w, h)
		ret = min_n + (min_n - 1) * (max_n - min_n + (min_n - 2))
		print(ret)
main()


import math
T = int(input())
for _ in range(1, T + 1):
	(a, b, c, d) = map(int, input().split())
	ans = (c - a) * (d - b) + 1
	print(ans)


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

def li():
	return list(map(int, sys.stdin.readline().split()))

def num():
	return map(int, sys.stdin.readline().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007

def solve():
	t = nu()
	for tt in range(t):
		(x1, y1, x2, y2) = num()
		print((x2 - x1) * (y2 - y1) + 1)
solve()


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def fact(x):
	ans = 1
	while x > 1:
		ans *= x
		x -= 1
	return ans

def main():
	t = inp()
	for l in range(t):
		(x1, y1, x2, y2) = invr()
		(m, n) = (x2 - x1, y2 - y1)
		print(m * n + 1)
main()


import sys
import heapq

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, input().split())

def rlinput():
	return list(map(int, input().split()))

def srlinput():
	return sorted(list(map(int, input().split())))

def main():
	(x, y, x1, y1) = rinput()
	print(1 + (x - x1) * (y - y1))
for i in range(iinput()):
	main()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())

	def left(n):
		return (n * (n + 1) * (2 * n + 1) + 3 * n * (n + 1) * (2 * y1 - 1) + 6 * (n + 1) * (y1 - 1) * (y1 - 2)) // 12

	def lower(n):
		return (n * (n + 1) * (2 * n + 1) + 3 * n * (n + 1) * (2 * x2 - 3) + 6 * (n + 1) * (x2 - 1) * (x2 - 2)) // 12 + (n + 1) * x2

	def upper(n):
		return (n * (n + 1) * (2 * n + 1) + 3 * n * (n + 1) * (2 * x1 - 3) + 6 * (n + 1) * (x1 - 1) * (x1 - 2)) // 12 + (n + 1) * x1

	def right(n):
		return (n * (n + 1) * (2 * n + 1) + 3 * n * (n + 1) * (2 * y2 - 1) + 6 * (n + 1) * (y2 - 1) * (y2 - 2)) // 12
	m = upper(y2) - upper(y1 - 1) + right(x2) - right(x1 - 1) - (x1 + y2 - 1) * (x1 + y2 - 2) // 2 - x1
	M = left(x2) - left(x1 - 1) + lower(y2) - lower(y1 - 1) - (x2 + y1 - 1) * (x2 + y1 - 2) // 2 - x2
	print(M - m + 1)


def sum(l, r):
	if l > r:
		return 0
	l -= 1
	res = r * (r + 1) * (2 * r + 4) // 12
	res -= l * (l + 1) * (2 * l + 4) // 12
	return res
t = int(input())
while t > 0:
	inp = list(input().split())
	x = int(inp[2]) - int(inp[0]) + 1
	y = int(inp[3]) - int(inp[1]) + 1
	lo = sum(1, x - 1)
	lo += sum(x + 1, x + y - 1)
	hi = sum(2, y)
	hi += sum(y, x + y - 2)
	if hi > lo:
		print(hi - lo + 1)
	else:
		print(lo - hi + 1)
	t -= 1


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
for _ in range(tc):
	(x1, y1, x2, y2) = iia()
	temp1 = x2 - x1
	temp2 = y2 - y1
	print(temp1 * temp2 + 1)


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
for _ in range(int(cin())):
	(a, b, x, y) = map(int, cin().split())
	cout(str(min(x - a, y - b) * (min(x - a, y - b) + 1) + (x - a + y - b + 1 - min(x - a, y - b) * 2 - 2) * min(x - a, y - b) + 1) + '\n')


from math import ceil, sqrt, log

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def is_square(n):
	return int(sqrt(n)) * int(sqrt(n)) == n

def find_div(n):
	d = []
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			if i * i != n:
				d.append(i)
				d.append(n / i)
			else:
				d.append(i)
	return d

def find_x(n):
	d = find_div(2 * n)
	for div in d:
		x2 = div * (div + 2 * n)
		if is_square(x2):
			return sqrt(x2)
	return -1

def find_base_side(n):
	squares = [x * x for x in range(ceil(sqrt(n)))]
	for i in range(len(squares)):
		for j in range(len(squares)):
			if squares[i] + squares[j] == n * n:
				return squares[i]
	return -1

def str_add(n):
	n = list(n)
	for i in range(1, len(n) + 1):
		if n[-i] == '9':
			n[-i] = '0'
		else:
			n[-i] = int(int(n[-i]) + 1)
			break
	n = str(n)
	return n

def str_sub(n):
	n = list(n)
	for i in range(1, len(n) + 1):
		if n[-i] == '0':
			n[-i] = '9'
		else:
			n[-i] = int(int(n[-i]) - 1)
			break
	n = str(n)
	return n

def find_massive_x(n):
	if n % 2 == 0:
		n2 = str(int(pow(n / 2, 2)))
		x = str_sub(n2)
		y = str_add(n2)
	else:
		n2 = str(int(pow(n, 2) / 2))
		x = str_sub(n2)
		y = str_add(n2)
	x = str(x)
	y = str(y)
	print(x, y)

def find_triples(n):
	if n <= 2:
		print(-1)
		return
	else:
		x = find_massive_x(n)
	print(-1)

def find_max_xor(l, r):
	lxr = l ^ r
	msb_pos = 0
	while lxr > 0:
		msb_pos += 1
		lxr //= 2
	return pow(2, msb_pos) - 1

def count_ways(x1, y1, x2, y2):
	return (x1 - x2) * (y1 - y2) + 1
t = 1
t = int(input())
while t:
	t = t - 1
	(x1, y1, x2, y2) = map(int, input().split())
	print(count_ways(x1, y1, x2, y2))


T = int(input())
while T:
	(x1, y1, x2, y2) = map(int, input().split())
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans)
	T -= 1


for _ in range(int(input())):
	(a, b, m, n) = [int(i) for i in input().split()]
	print((a - m) * (b - n) + 1)


import sys
input = sys.stdin.readline
flush = sys.stdout.flush
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	m = x2 - x1
	n = y2 - y1
	(m, n) = (max(m, n), min(m, n))
	print(1 + m * n)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	(dx, dy) = (abs(x1 - x2), abs(y1 - y2))
	print(dx * dy + 1)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = list(map(int, input().strip().split()))
	u = x2 - x1
	d = y2 - y1
	ans = u * d + 1
	print(ans)


T = int(input())
for test in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x1 - x2) * (y1 - y2) + 1)


import sys
from math import pi, cos
TEST = 0
if TEST == 1:
	input_file = open('inputC.txt', 'r')
	input_from_file = input_file.readlines()

def read_int():
	if TEST:
		return int(input_from_file.pop(0))
	else:
		return int(sys.stdin.readline())

def read_ints():
	if TEST:
		return list(map(int, input_from_file.pop(0).rstrip().split()))
	else:
		return list(map(int, sys.stdin.readline().split()))
t = read_int()
for test in range(t):
	(x1, y1, x2, y2) = read_ints()
	if x2 - x1 == 0 and y2 - y1 == 0:
		ans = 1
	elif x2 - x1 == 0 or y2 - y1 == 0:
		ans = 1
	else:
		var1 = x2 - x1
		var2 = y2 - y1
		n = max(var1, var2)
		m = min(var1, var2)
		ans = m * n + 1
	print(ans)


import sys
input = sys.stdin.readline
Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
for (x1, y1, x2, y2) in Query:
	a = x2 - x1
	b = y2 - y1
	ans = a * b + 1
	print(ans)


from math import *
import random
mod = 1000000007
r1 = lambda : int(input())
rm = lambda : map(int, input().split())
rls = lambda : list(rm())
test = int(input())
while test:
	test -= 1
	(x1, y1, x2, y2) = rm()
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		x = abs(x1 - x2)
		y = abs(y1 - y2)
		print(x * y + 1)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	a = abs(y2 - y1)
	b = abs(x2 - x1)
	c = 1
	print(a * b + c)


t = int(input())
ans = []
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	vniz = y2 - y1
	vpravo = x2 - x1
	min1 = vniz * (vniz + 1) // 2
	max1 = (vpravo + vniz) * (vpravo + vniz + 1) // 2 - vpravo * (vpravo + 1) // 2
	ans.append(max1 - min1 + 1)
for i in ans:
	print(i)


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(ii()):
	(a, b, c, d) = f()
	print((c - a) * (d - b) + 1)


def solve():
	coor = list(map(int, input().split()))
	(x1, y1, x2, y2) = (coor[0], coor[1], coor[2], coor[3])
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans)
T = int(input())
while T:
	solve()
	T = T - 1


from sys import stdin
cin = stdin.readline

def value(x, y):
	n = x + y - 1
	return y + n * (n - 1) // 2

def rowsum(a, b):
	u = value(1, b)
	return u * a + a * (a - 1) * (a + 3 * b - 2) // 6

def colsum(a, b):
	u = value(a, 1)
	return u * b + b * (b - 1) * (3 * a + b + 1) // 6
for _ in range(int(cin())):
	(a, b, c, d) = map(int, cin().split())
	r = rowsum(c, b) - rowsum(a, b) + value(a, b)
	s = colsum(c, d) - colsum(c, b)
	p = rowsum(c, d) - rowsum(a, d)
	q = colsum(a, d) - colsum(a, b) + value(a, b)
	print(1 + p + q - r - s)


import queue
import math
t = int(input())

def s1(n):
	return n * (n + 1) // 2

def s2(n):
	return n * (n + 1) * (2 * n + 1) // 6

def row(i, n):
	return ((i * i - i + 2) * (n + 1) + s2(n) + (2 * i - 3) * s1(n)) // 2

def col(j, n):
	return ((j * j - 3 * j + 2) * (n + 1) + s2(n) + (2 * j - 1) * s1(n)) // 2
while t:
	line = input().split()
	(i1, j1, i2, j2) = (int(line[0]), int(line[1]), int(line[2]), int(line[3]))
	m = row(i1, j2) - row(i1, j1 - 1) + col(j2, i2) - col(j2, i1)
	M = row(i2, j2) - row(i2, j1 - 1) + col(j1, i2 - 1) - col(j1, i1 - 1)
	print(M - m + 1)
	t -= 1


t = int(input())
for _ in range(t):
	(x1, x2, x3, x4) = map(int, input().split())
	if x1 == x3 or x2 == x4:
		print(1)
	else:
		y = abs((x3 - x1) * (x4 - x2)) + 1
		print(y)


t = int(input())

def f1(x1, x2):
	return x2 * (x2 + 1) // 2 - (x1 - 1) * x1 // 2

def f2(x1, x2):
	return x2 * (x2 + 1) * (2 * x2 + 1) // 6 - (x1 - 1) * x1 * (2 * x1 - 1) // 6

def func1(x_c, y1, y2):
	if y1 > y2:
		return 0
	return f1(y1, y2) + (x_c ** 2 * (y2 - y1 + 1) + f2(y1, y2) + 2 * x_c * f1(y1, y2) - 3 * x_c * (y2 - y1 + 1) - 3 * f1(y1, y2) + 2) // 2

def func2(y_c, x1, x2):
	x_c = y_c
	y1 = x1
	y2 = x2
	if y1 > y2:
		return 0
	return x_c * (y2 - y1 + 1) + (x_c ** 2 * (y2 - y1 + 1) + f2(y1, y2) + 2 * x_c * f1(y1, y2) - 3 * x_c * (y2 - y1 + 1) - 3 * f1(y1, y2) + 2) // 2
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		a1 = func1(x1, y1, y2) + func2(y2, x1 + 1, x2)
		a2 = func2(y1, x1, x2) + func1(x2, y1 + 1, y2)
		print(a1 - a2 + 1)


for i in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	(h, w) = (y2 - y1, x2 - x1)
	print(h * w + 1)


t = int(input())
for i in range(0, t):
	L = input().split()
	h = int(L[2]) - int(L[0])
	v = int(L[3]) - int(L[1])
	print(h * v + 1)


x = int(input())
for i in range(x):
	(a, b, c, d) = map(int, input().split())
	rig = c - a
	dow = d - b
	total = rig * dow
	print(total + 1)


from math import *
import sys
input = sys.stdin.buffer.readline
a = int(input())
for _ in range(a):
	(b, c, d, e) = map(int, input().split())
	if min(abs(d - b), abs(e - c)) == 0:
		print(1)
	else:
		print((d - b) * (e - c) + 1)


for _ in range(int(input())):
	(i1, j1, i2, j2) = map(int, input().split())
	print((i2 - i1) * (j2 - j1) + 1)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = input().split()
	x1 = int(x1)
	y1 = int(y1)
	x2 = int(x2)
	y2 = int(y2)
	x = x2 - x1
	y = y2 - y1
	ans = x * y + 1
	print(ans)


def rowsum(x, y):
	return x * (y - 1) + (y - 2) * (y - 1) // 2

def colsum(x, y):
	return y * (x - 1) + x * (x - 1) // 2

def get(i, j):
	return rowsum(1, j) + colsum(i, j) + 1

def rsum(x, y):
	return (y + 1) * y // 2 - y + y * (y - 1) * (y - 2) // 6 + (y + 1) * y * (x - 1) // 2 + y * x * (x - 1) // 2 + y

def csum(x, y):
	return (y - 1) * x + (y - 2) * (y - 1) // 2 * x + y * x * (x - 1) // 2 + (x + 1) * x * (x - 1) // 6 + x

def calc(x0, y0, x1, y1):
	u = rsum(x0, y1) - rsum(x0, y0 - 1) + csum(x1, y1) - csum(x0, y1)
	v = csum(x1, y0) - csum(x0 - 1, y0) + rsum(x1, y1) - rsum(x1, y0)
	return v - u + 1

def solve():
	print(calc(*map(int, input().split())))
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	dx = x2 - x1
	dy = y2 - y1
	if dx == dy:
		print(dx * (dx + 1) - dx + 1)
	else:
		mid = min(dx, dy)
		mad = max(dx, dy)
		print(mid * (mid + 1) + (mad - mid - 1) * mid + 1)


from sys import stdin
import math

def readline():
	return stdin.readline()
tests = int(readline())

def solve(x1, y1, x2, y2):
	if x1 == x2 or y1 == y2:
		return 1
	return (x2 - x1) * (y2 - y1) + 1
for t in range(0, tests):
	(x1, y1, x2, y2) = list(map(int, readline().split(' ')))
	print(solve(x1, y1, x2, y2))


for _ in range(int(input())):
	(x, y, z, w) = map(int, input().split())
	print((x - z) * (y - w) + 1)


import math
import sys
import collections
from collections import defaultdict
sys.setrecursionlimit(10 ** 9)
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	print(abs(x1 - x2) * abs(y1 - y2) + 1)


n = int(input())
while n != 0:
	cordinates = list(map(int, input().split()))
	print(abs(cordinates[0] - cordinates[2]) * abs(cordinates[1] - cordinates[3]) + 1)
	n = n - 1


def run():
	import sys
	sys.stdin = open('/home/punit/Documents/Cpp Programs/input.txt', 'r')
	sys.stdout = open('/home/punit/Documents/Cpp Programs/output.txt', 'w')
	from math import ceil, sqrt, floor
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	ans = (a - x) * (b - y) + 1
	print(ans)


import math
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	p = c - a
	q = d - b
	print(1 + p * q)


def readintlst():
	return list(map(int, input().split(' ')))

def readn():
	return int(input())

def getVal(x, y):
	lvl = x + y - 1
	s = 1 + (lvl - 1) * lvl // 2
	return x - 1 + s

def calSameLine(x1, y1, x2, y2):
	if x1 == x2:
		v = getVal(x1, y1)
		vn = getVal(x1, y1 + 1)
		d = vn - v
		n = y2 - y1
		ans = n * v
		i = 0
		while n > 0:
			ans += (d + i) * n
			n -= 1
			i += 1
		return ans
	if y1 == y2:
		v = getVal(x1, y1)
		vn = getVal(x1 + 1, y1)
		d = vn - v
		n = x2 - x1
		ans = n * v
		i = 0
		while n > 0:
			ans += (d + i) * n
			n -= 1
			i += 1
		return ans

def dfs(x1, y1, val):
	global x2, y2, L
	if x1 == x2 or y1 == y2:
		L.append(calSameLine(x1, y1, x2, y2) + val)
		return
	for (dx, dy) in [(1, 0), (0, 1)]:
		(xx, yy) = (x1 + dx, y1 + dy)
		if xx > x2 or yy > y2:
			continue
		dfs(xx, yy, val + getVal(xx, yy))

def uniquePaths(m, n):
	if not m or not n:
		return 0
	cur = [1] * n
	for i in range(1, m):
		for j in range(1, n):
			cur[j] += cur[j - 1]
	return cur[-1]
n = readn()
for _ in range(n):
	(x1, y1, x2, y2) = readintlst()
	print((x2 - x1) * (y2 - y1) + 1)


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	m1 = abs(c - a)
	m2 = abs(d - b)
	print(m1 * m2 + 1)


import sys
input = sys.stdin.readline
t = int(input())
for q in range(t):
	(x, y, w, z) = map(int, input().split())
	if x - w == 0 or y - z == 0:
		print(1)
		continue
	else:
		print((w - x) * (z - y) + 1)


from math import ceil

def cd(a, b):
	x = b * (b - 1) // 2 + 1
	m = b + 1
	c = a - 1
	y = (m + c) * (m + c - 1) // 2 - m * (m - 1) // 2 + x
	return y

def abc(i, j, m, n, x):
	if i > m or j > n:
		return
	global d
	y = cd(i, j)
	if i == m and j == n:
		d[x + y] = 0
		return
	abc(i + 1, j, m, n, x + y)
	abc(i, j + 1, m, n, x + y)
t = int(input())
for _ in range(t):
	d = {}
	(x1, x2, y1, y2) = map(int, input().split())
	print((y1 - x1) * (y2 - x2) + 1)


import sys, math, cmath, time
start_time = time.time()
global tt

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def solve():
	(a, b, c, d) = invr()
	print(1 + abs(a - c) * abs(b - d))

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
	sys.stdout.close()

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


t = int(input())
while t:
	t -= 1
	(q, x, y, z) = list(map(int, input().split()))
	print(abs(q - y) * abs(x - z) + 1)


from sys import stdin
from math import ceil

def func():
	return
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	print(abs(x1 - x2) * abs(y1 - y2) + 1)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(a, b, m, n) = [int(i) for i in input().split()]
	ans = (a - m) * (b - n) + 1
	print(ans)


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	dx = x2 - x1
	dy = y2 - y1
	ans = 1
	minv = min(dx, dy)
	ans += (1 + minv) * minv // 2 + (dx - minv) * minv
	ans += (1 + minv) * minv // 2 + (dy - minv) * minv
	ans -= minv
	print(ans)


TC = int(input())
for cn in range(TC):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	x = x2 - x1 + 1
	y = y2 - y1 + 1
	print((x - 1) * (y - 1) + 1)


T = int(input())
for t_itr in range(T):
	(X1, Y1, X2, Y2) = list(map(int, input().rstrip().split()))
	result = (X2 - X1) * (Y2 - Y1) + 1
	print(result)


import sys

def run_case():
	(x1, y1, x2, y2) = map(int, input().split())
	d1 = x2 - x1
	d2 = y2 - y1
	if d1 > d2:
		(d1, d2) = (d2, d1)
	print((d2 - d1 - 1) * d1 + d1 * (d1 + 1) + 1)
t = int(input())
for _ in range(t):
	run_case()


t = int(input())
while t:
	t -= 1
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print('1')
	else:
		print(abs(x1 - x2) * abs(y1 - y2) + 1)


import math
t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = [int(x1) for x1 in input().split()]
	p = x2 - x1
	q = y2 - y1
	print(q * p + 1)


import sys
import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
setrecursionlimit(2 ** 20)
M = 10 ** 9 + 7
T = int(stdin.readline())
for _ in range(T):
	(x1, y1, x2, y2) = list(map(int, stdin.readline().split()))
	ans = 1
	ans += (x2 - x1) * (y2 - y1)
	print(ans)


for i in range(int(input())):
	num = list(map(int, input().split()))
	print((num[3] - num[1]) * (num[2] - num[0]) + 1)


def fun4(y2, x2):
	a = 1
	b = 2 * y2 - 3
	c = y2 * y2 + y2 + 2 - 2 * y2
	aa = x2 * (x2 + 1) * (2 * x2 + 1) // 6
	bb = x2 * (x2 + 1) // 2
	cc = x2
	return (a * aa + b * bb + c * cc) // 2

def fun2(x2, y2):
	a = 1
	b = 2 * x2 - 1
	c = x2 * x2 - x2 + 2 - 2 * x2
	aa = y2 * (y2 + 1) * (2 * y2 + 1) // 6
	bb = y2 * (y2 + 1) // 2
	cc = y2
	return (a * aa + b * bb + c * cc) // 2
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == 1:
		one = fun4(y1, x2)
		four = fun4(y2, x2)
	else:
		one = fun4(y1, x2) - fun4(y1, x1 - 1)
		four = fun4(y2, x2) - fun4(y2, x1 - 1)
	if y1 == 1:
		three = fun2(x1, y2)
		two = fun2(x2, y2)
	else:
		three = fun2(x1, y2) - fun2(x1, y1 - 1)
		two = fun2(x2, y2) - fun2(x2, y1 - 1)
	l = one + two
	r = three + four
	l -= (y1 * y1 + (2 * x2 - 1) * y1 + (x2 * x2 - x2) + 2 - 2 * x2) // 2
	r -= (x1 * x1 + (2 * y2 - 3) * x1 + (y2 * y2 + y2) + 2 - 2 * y2) // 2
	print(r - l + 1)


def rnum():
	return int(input())

def rnums():
	return map(int, input().split())

def rlist():
	return list(map(int, input().split()))

def solve():
	(a, b, c, d) = rnums()
	(x, y) = (c - a, d - b)
	print(x * y + 1)

def main():
	t = rnum()
	for i in range(t):
		solve()
main()


from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def printNcR(n, r):
	p = 1
	k = 1
	if n - r < r:
		r = n - r
	if r != 0:
		while r:
			p *= n
			k *= r
			m = GCD(p, k)
			p //= m
			k //= m
			n -= 1
			r -= 1
	else:
		p = 1
	return p

def main():
	for _ in range(inin()):
		(x1, y1, x2, y2) = map(int, input().split())
		a = abs(x2 - x1)
		b = abs(y2 - y1)
		print(a * b + 1)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def fun(f, c, n):
	aa = int((n * (n + 1) * (2 * n + 1) + (2 * c - 3) * n * (n + 1) * 3 + 12 * (f - c + 1) * n) // 12)
	return aa
t = int(input())
i = 0
while i < t:
	(x1, y1, x2, y2) = input().split()
	x1 = int(x1)
	x2 = int(x2)
	y1 = int(y1)
	y2 = int(y2)
	x2 -= x1 - 1
	y2 -= y1 - 1
	xth = (x2 * x2 + x2) // 2
	yth = (y2 * y2 - y2) // 2 + 1
	sm = fun(1, 1, y2 - 1) + fun(yth, y2 + 1, x2)
	lg = fun(1, 2, x2 - 1) + fun(xth, x2, y2)
	print(lg - sm + 1)
	i += 1


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda : int(input())
ip = lambda : [int(w) for w in input().split()]
for _ in range(inp()):
	(x1, y1, x2, y2) = ip()
	m = abs(x2 - x1)
	n = abs(y2 - y1)
	print(m * n + 1)


from math import factorial

def read():
	return [int(i) for i in input().split()]
t = int(input())
for _ in range(t):
	(a, b, c, d) = read()
	(n, m) = (c - a, d - b)
	ans = n * m + 1
	print(ans)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	(r, c, rf, cf) = map(int, stdin.readline().strip().split())
	print((rf - r) * (cf - c) + 1)


import sys
input = sys.stdin.readline

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	(x1, y1, x2, y2) = int_array()
	print((x2 - x1) * (y2 - y1) + 1)


import sys
import math
from math import factorial as f
from collections import defaultdict as dd
mod = 1000000007
T = 1
T = int(sys.stdin.readline())
l = []
for _ in range(T):
	(x1, y1, x2, y2) = map(int, sys.stdin.readline().split())
	p = x2 - x1
	q = y2 - y1
	ans = p * q + 1
	print(ans)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	xd = x2 - x1
	yd = y2 - y1
	print(xd * yd + 1)


def solve(x1, y1, x2, y2):
	total_path = x2 - x1 + y2 - y1
	dengbi = min(x2 - x1, y2 - y1)
	deng_bi_he = dengbi * dengbi
	rest = (total_path - dengbi * 2) * dengbi
	return rest + deng_bi_he + 1
t = int(input())
for _ in range(t):
	(a, b, c, d) = list(map(int, input().split()))
	print(solve(a, b, c, d))


import sys
t = int(sys.stdin.readline())
for i in range(t):
	nums = [int(x) for x in sys.stdin.readline().split()]
	x1 = nums[0]
	y1 = nums[1]
	x2 = nums[2]
	y2 = nums[3]
	xdiff = x2 - x1
	ydiff = y2 - y1
	sum = 0
	sum += min(xdiff, ydiff) * min(xdiff, ydiff)
	sum += min(xdiff, ydiff) * abs(xdiff - ydiff)
	print(sum + 1)


from math import *
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	(x, y) = (c - a, d - b)
	print(x * y + 1)


T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = [int(z) for z in input().split()]
	x = x2 - x1
	y = y2 - y1
	a = min(x, y)
	b = max(x, y)
	result = a * (a + 1)
	result += (b - a - 1) * a
	result += 1
	print(result)


def sum(n):
	return n * (n + 1) // 2

def sqsum(n):
	return n * (n + 1) * (n * 2 + 1) // 6

def vsum(r1, r2, c):
	res = 0
	res += sqsum(r2) - sqsum(r1 - 1)
	res += (sum(r2) - sum(r1 - 1)) * (c * 2 - 1)
	res += (r2 - r1 + 1) * (c * c - c)
	res //= 2
	res += (1 - c) * (r2 - r1 + 1)
	return res

def hsum(r1, r2, c):
	res = 0
	res += sqsum(r2) - sqsum(r1 - 1)
	res += (sum(r2) - sum(r1 - 1)) * (c * 2 - 1)
	res += (r2 - r1 + 1) * (c * c - c)
	res //= 2
	res += r2 - r1 + 1 - (sum(r2) - sum(r1 - 1))
	return res
t = int(input())
for _ in range(t):
	(r1, c1, r2, c2) = map(int, input().split())
	ub = vsum(r1, r2, c1) + hsum(c1 + 1, c2, r2)
	lb = hsum(c1, c2, r1) + vsum(r1 + 1, r2, c2)
	print(ub - lb + 1)


for _ in range(int(input())):
	(sx, sy, ds, dy) = map(int, input().split(' '))
	print(abs((ds - sx) * (dy - sy)) + 1)


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	dx = x2 - x1
	dy = y2 - y1
	(mi, ma) = sorted([dx, dy])
	res = mi * (mi + 1) + mi * (ma - mi - 1) + 1
	print(res)


def solve():
	(x1, y1, x2, y2) = map(int, input().split())
	deltax = x2 - x1
	deltay = y2 - y1
	print(deltax * deltay + 1)
t = int(input())
for tt in range(t):
	solve()


t = int(input())
for ii in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	m = x2 - x1
	n = y2 - y1
	print(m * n + 1)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys

def solve(x, y):
	if x == 0:
		return 1
	return x ** 2 + (y - x) * x + 1

def main():
	t = int(input())
	for _ in range(t):
		(x1, y1, x2, y2) = map(int, input().split())
		dx = x2 - x1
		dy = y2 - y1
		if dx > dy:
			(dx, dy) = (dy, dx)
		ans = solve(dx, dy)
		sys.stdout.write(str(ans) + '\n')
main()


q = int(input())
for i in range(q):
	(x1, y1, x2, y2) = map(int, input().split())
	a = abs(x1 - x2)
	b = abs(y1 - y2)
	a += 1
	b += 1
	if a < b:
		(a, b) = (b, a)
	if a == b:
		print((a - 1) ** 2 + 1)
	else:
		wynik = b * (b - 1) + (b - 1) * (a - b - 1) + 1
		if a == b:
			wynik -= b - 1
		print(wynik)


T = int(input())

def ans(x1, y1, x2, y2):
	x = x2 - x1 + 1
	y = y2 - y1 + 1
	return (x - 1) * (y - 1) + 1
for t in range(T):
	(x1, y1, x2, y2) = input().split(' ')
	x1 = int(x1)
	y1 = int(y1)
	x2 = int(x2)
	y2 = int(y2)
	print(ans(x1, y1, x2, y2))


from sys import stdin
for _ in range(int(input())):
	l = list(map(int, stdin.readline().rstrip().split(' ')))
	m = l[2] - l[0] + 1
	n = l[3] - l[1] + 1
	(m, n) = (min(m, n), max(m, n))
	if m == 0 or n == 0:
		print(1)
	else:
		t = (m - 1) * (n - m + 1)
		t += (m - 2) * (m - 1) + 1
		print(t)


from math import sqrt
t = int(input())
for qq in range(t):
	(x1, y1, x2, y2) = [int(i) for i in input().split()]
	dx = x2 - x1
	dy = y2 - y1
	a1 = x1 + y1
	n = dx + dy
	s1 = (n - dy + n) * dy // 2
	s2 = (n - dx) * dy // 2
	print(s1 - s2 + 1)


test = int(input())
for i in range(test):
	(x1, y1, x2, y2) = [int(i) for i in input().split()]
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		path = 1
		n = x2 - x1
		m = y2 - y1
		print(m * n + 1)


t = int(input())
while t:
	t -= 1
	(x1, y1, x2, y2) = map(int, input().split())
	m = x2 - x1
	n = y2 - y1
	print(m * n + 1)


qq = int(input())
for _ in range(qq):
	(x1, y1, x2, y2) = map(int, input().split())
	dx = x2 - x1
	dy = y2 - y1
	n = dy + dx + 1
	ans = 0
	ans1 = n * (n ** 2 + 5) // 6 + (dy + 1) * dy // 2
	ans2 = n * (n + 1) * (n + 2) // 6 - (dx + 1) * dx // 2
	print(ans2 - ans1 + 1)


def sum_upto_n(n):
	return n * (n + 1) // 2

def square_sum_upto_n(n):
	return n * (n + 1) * (2 * n + 1) // 6

def column_sum_n_terms(c, n):
	return sum_upto_n(n - 1) * (c + 1) + (square_sum_upto_n(n) - 3 * sum_upto_n(n)) // 2 + n * (sum_upto_n(c - 1) + 2)

def column_sum(c, x1, x2):
	if x1 > x2:
		return 0
	else:
		return column_sum_n_terms(c, x2) - column_sum_n_terms(c, x1 - 1)

def row_sum_n_terms(r, n):
	return sum_upto_n(n - 1) * r + (square_sum_upto_n(n) - 3 * sum_upto_n(n)) // 2 + n * (sum_upto_n(r) + 1)

def row_sum(r, y1, y2):
	if y1 > y2:
		return 0
	else:
		return row_sum_n_terms(r, y2) - row_sum_n_terms(r, y1 - 1)

def main():
	test = int(input())
	for _ in range(test):
		(x1, y1, x2, y2) = map(int, input().split())
		max_sum = column_sum(y1, x1, x2) + row_sum(x2, y1 + 1, y2)
		min_sum = row_sum(x1, y1, y2) + column_sum(y2, x1 + 1, x2)
		ans = max_sum - min_sum + 1
		print(ans)
main()


import sys
input = iter(sys.stdin.read().splitlines()).__next__
sys.setrecursionlimit(10000)
TC = int(input())
A = [tuple(map(int, input().split())) for _ in range(TC)]
res = ['%s' % ((x2 - x1) * (y2 - y1) + 1) for (x1, y1, x2, y2) in A]
print('\n'.join(res))


t = int(input())
for tc in range(t):
	s = input().split()
	(x1, y1, x2, y2) = (int(s[0]), int(s[1]), int(s[2]), int(s[3]))
	print((x2 - x1) * (y2 - y1) + 1)


for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		X = x2 - x1
		Y = y2 - y1
		mi = min(X, Y)
		mx = max(X, Y)
		print(1 + 2 * (mi * (mi + 1)) // 2 + mi * (mx - mi) - mi)


import sys

def get_level(x, y):
	return x + y - 1

def get_num(x, y):
	lvl = get_level(x, y)
	return lvl * (lvl - 1) // 2 + y

def sm(n):
	return n * (n + 1) // 2

def series_sum(n):
	return n * (n + 1) * (n + 2) // 6
t = int(input())
for _ in range(t):
	(x, y, x1, y1) = map(int, input().split())
	h = y1 - y + 1
	w = x1 - x + 1
	l = get_num(x, y) * h + get_level(x, y) * sm(h - 1) + series_sum(h - 1)
	r = get_num(x1, y) * h + get_level(x1, y) * sm(h - 1) + series_sum(h - 1)
	u = get_num(x, y) * w + get_level(x, y) * sm(w - 1) + series_sum(w - 2)
	d = get_num(x, y1) * w + get_level(x, y1) * sm(w - 1) + series_sum(w - 2)
	dr = l + d - get_num(x, y1)
	rd = u + r - get_num(x1, y)
	print(dr - rd + 1)


import sys
import math
import random
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	(a, b, x, y) = invr()
	_x = a - 1
	_y = b - 1
	x -= _x
	y -= _y
	ans = 1 + (x - 1) * (y - 1)
	print(ans)


import sys
ints = (int(x) for x in sys.stdin.read().split())
sys.setrecursionlimit(3000)

def main():
	ntc = next(ints)
	for tc in range(1, ntc + 1):
		(x1, y1, x2, y2) = (next(ints) for i in range(4))
		(n, m) = (min(y2 - y1, x2 - x1), max(y2 - y1, x2 - x1))
		print(1 + n * (n - 1) + n * (m - n + 1))
	return
main()


for t in range(int(input())):
	(x0, y0, x1, y1) = (int(i) for i in input().split(' '))
	i = min(x1 - x0, y1 - y0)
	j = max(x1 - x0, y1 - y0)
	print(i * j + 1)


def main():
	n = int(input())
	i = 0
	while i < n:
		(x1, y1, x2, y2) = [int(i) for i in input().split()]
		pathsX = x1 - x2
		pathsX = abs(pathsX)
		pathsY = y1 - y2
		pathsY = abs(pathsY)
		print(pathsY * pathsX + 1)
		i += 1
main()


t = int(input())
for k in range(t):
	(x1, y1, x2, y2) = map(int, input().rstrip().split())
	print((x2 - x1) * (y2 - y1) + 1)


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi
import heapq

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def main():
	try:
		(x1, y1, x2, y2) = In()
		(x, y) = (x2 - x1, y2 - y1)
		print(x * y + 1)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


T = int(input())
for _ in range(T):
	(X1, Y1, X2, Y2) = map(int, input().split())
	print(1 + (X2 - X1) * (Y2 - Y1))


from sys import stdin
from math import factorial as f

def print1():
	mt = [[0 for i in range(12)] for j in range(12)]
	z = 1
	x = 0
	for i in range(10):
		y = i
		x = 0
		while y >= 0:
			mt[x][y] = z
			z += 1
			y -= 1
			x += 1
	for i in mt:
		print(i)

def sum(n):
	return n * (n + 1) // 2

def sum2(n):
	x = n * (n + 1) * (2 * n + 1)
	return x // 6

def sumf(n, m):
	return n * (sum(n) - sum(m)) - sum2(n) + sum(n) - sum(m) + sum2(m)
T = int(stdin.readline().strip())
for caso in range(T):
	s = list(map(int, stdin.readline().strip().split()))
	n = s[2] - (s[0] - 1) - 1
	m = s[3] - (s[1] - 1) - 1
	x = sumf(n + 1, 0) + sumf(n + m, n) + sum(n + 1) * m
	y = sumf(m + 1, 0) - sum(m) + sumf(n + m + 1, m + 1) + (sum(m + 1) - m) * n
	print(x - y + 1)

def sm(a, b):
	ans = 0
	for i in range(a, b + 1):
		ans += i * (b - i + 1)
	print(ans)


import sys
import math
import collections

def set_debug(debug_mode=False):
	if debug_mode:
		fin = open('input.txt', 'r')
		sys.stdin = fin
t = int(input())
for ti in range(1, t + 1):
	(a, b, c, d) = list(map(int, input().split()))
	print((c - a) * (d - b) + 1)


import sys
input = sys.stdin.readline
x = int(input())
for i in range(x):
	(a, b, c, d) = map(int, input().split())
	rig = c - a
	dow = d - b
	total = rig * dow
	print(total + 1)


t = int(input())
for test in range(t):
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	x = abs(x1 - x2)
	y = abs(y1 - y2)
	print(x * y + 1)


import collections as cc
import heapq as hp
import math as mt
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(a, b, c, d) = I()
	n = c - a
	m = d - b
	print(n * m + 1)


t = int(input())
for i in range(t):
	(x, y, x2, y2) = map(int, input().split())
	x = x2 - x
	y = y2 - y
	print(x * y + 1)


import sys
for t in range(int(input())):
	res = 0
	(x1, y1, x2, y2) = map(int, sys.stdin.readline().strip().split())
	print((x2 - x1) * (y2 - y1) + 1)


import math
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	ans = abs(x1 - x2) * abs(y1 - y2) + 1
	print(ans)


for __ in range(int(input())):
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	n = abs(x1 - x2)
	m = abs(y1 - y2)
	print(1 + n * m)


for loop in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	x = c - a
	y = d - b
	print(x * y + 1)


import sys

def input():
	return sys.stdin.readline().rstrip()

def get(x, y):
	ind = x + y - 1
	temp = 1 + ind * (ind - 1) // 2
	return temp + x - 1

def sum_first_row_till(n):
	return n + n * (n - 1) * (n + 1) // 6

def sum_xth_row(x, y1, y2):
	s1 = sum_first_row_till(y2 + x - 1) - sum_first_row_till(x - 1)
	s2 = sum_first_row_till(y1 - 1 + x - 1) - sum_first_row_till(x - 1)
	return s1 - s2 + (x - 1) * (y2 - y1 + 1)

def sum_first_column_till(n):
	return n * (n + 1) * (n + 2) // 6

def sum_yth_colum(y, x1, x2):
	s1 = sum_first_column_till(x2 + y - 1) - sum_first_column_till(y - 1)
	s2 = sum_first_column_till(x1 - 1 + y - 1) - sum_first_column_till(y - 1)
	return s1 - s2 - (y - 1) * (x2 - x1 + 1)
t = int(input())
answers = []
answers = []
for _ in range(t):
	(x1, y1, x2, y2) = [int(i) for i in input().split()]
	if x1 == x2 or y1 == y2:
		answers.append(1)
	else:
		num1 = y2 - y1 + 1
		num2 = x2 - x1 + 1
		lower = sum_xth_row(x1, y1, y2) + sum_yth_colum(y2, x1, x2) - get(x1, y2)
		upper = sum_yth_colum(y1, x1, x2) + sum_xth_row(x2, y1, y2) - get(x2, y1)
		answers.append(upper - lower + 1)
print(*answers, sep='\n')


def val(x, y):
	d = (x + y - 1) * (x + y) // 2
	return d - y + 1

def ssm(n):
	return n * (n + 1) * (n + 2) // 6

def ver(x, y):
	v = val(1, y)
	return ssm(x + y - 1) - ssm(y - 1) - x * (y * (y + 1) // 2 - v)

def hor(x, y):
	v = val(x, 1)
	return ssm(x + y - 2) - ssm(x - 2) - y * (x * (x - 1) // 2 - v)
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	mx = hor(x2, y2) - hor(x2, y1) + ver(x2, y1) - ver(x1 - 1, y1)
	mn = ver(x2, y2) - ver(x1, y2) + hor(x1, y2) - hor(x1, y1 - 1)
	print(mx - mn + 1)


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	(e, f) = (c - a, d - b)
	m = min(e, f)
	print((e + f - m) * m + 1)


test_cases = int(input())

def formula(last, first):
	big = last * (last + 1) // 2
	small = first * (first - 1) // 2
	return big - small
for tt in range(test_cases):
	(x1, y1, x2, y2) = [int(i) for i in input().split(' ')]
	right = x2 - x1
	down = y2 - y1
	total = right + down
	maxx = formula(total - 1, total - right)
	minn = right * (right - 1) // 2
	print(maxx - minn + 1)


import math

def dict_sort(ans):
	ans = sorted(ans.items(), reverse=True, key=lambda kv: kv[1])

def is_prime(n, k):
	if n == 1:
		return 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			res = i
			break
	return res

def inp():
	ls = list(map(int, input().split()))
	return ls
t = int(input())
for ii in range(t):
	ls = inp()
	ans1 = abs(ls[0] - ls[2])
	ans2 = abs(ls[1] - ls[3])
	if min(ans2, ans1) == 0:
		print(1)
	else:
		print(ans1 * ans2 + 1)


tc = int(input())
for _ in range(tc):
	cords = list(map(int, input().split()))
	print((cords[2] - cords[0]) * (cords[3] - cords[1]) + 1)


t = int(input())
for r in range(t):
	k = list(map(int, input().split()))
	p = abs(k[3] - k[1]) * abs(k[2] - k[0])
	p = p + 1
	print(p)


for _ in range(int(input())):
	(x, y, xx, yy) = map(int, input().split())
	print((xx - x) * (yy - y) + 1)


def getitem(x, y):
	tx = 1 + (2 + 2 + x - 1 - 1) * (x - 1) // 2
	ret = tx + (x + x + y - 2) * (y - 1) // 2
	return ret

def getsum(x, n):
	ret = n * (n + 1) // 2 * x * 2 + n * (n + 1) * (2 * n + 1) // 6 - n * (n + 1) // 2
	return ret // 2
T = int(input())
for i in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	x1y1 = getitem(x1, y1)
	x2y2 = getitem(x2, y2)
	x1y2 = getitem(x1, y2)
	x2y1 = getitem(x2, y1)
	mi = 0
	mx = 0
	mi += x1y1 * (y2 - y1 + 1) + getsum(x1 + y1 - 1, y2 - y1)
	mi += x1y2 * (x2 - x1 + 1) + getsum(y2 + 1 + x1 - 1, x2 - x1)
	mi -= x1y2
	mx += x1y1 * (x2 - x1 + 1) + getsum(y1 + 1 + x1 - 1, x2 - x1)
	mx += x2y1 * (y2 - y1 + 1) + getsum(x2 + y1 - 1, y2 - y1)
	mx -= x2y1
	print(mx - mi + 1)


amount = int(input())
(i0, j0, i1, j1) = (0, 0, 0, 0)
for i in range(amount):
	(i0, j0, i1, j1) = (int(i) for i in input().split())
	i_diff = i1 - i0
	j_diff = j1 - j0
	print(i_diff * j_diff + 1)


import sys, heapq
input = sys.stdin.buffer.readline
T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


def sigma(x):
	return x * (x + 1) // 2

def answer(arr):
	(a, b, c, d) = arr
	r = c - a + 1
	c = d - b + 1
	_max = min(r, c) - 1
	if r == c:
		return _max + sigma(_max - 1) * 2 + 1
	else:
		return max(abs(r - c) - 1, 0) * _max + sigma(_max) * 2 + 1
testCount = int(input())
for _ in range(testCount):
	arr = list(map(int, input().split()))
	print(answer(arr))


from sys import stdin, stdout
T = int(stdin.readline())
for i in range(T):
	(x1, y1, x2, y2) = map(int, stdin.readline().split())
	out = (x2 - x1) * (y2 - y1) + 1
	stdout.write(str(out) + '\n')


def a1p(a0, n, d0, d):
	return a0 * n + d0 * n * (n - 1) // 2 + d * n * (n - 1) * (n - 2) // 6

def cell(x1, y1):
	return (x1 + y1 - 2) * (x1 + y1 - 1) // 2 + x1
t = int(input())
for iiiii in range(t):
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	if x1 == x2 or y1 == y2:
		print(1)
		continue
	num1 = (x1 + y1 - 2) * (x1 + y1 - 1) // 2 + x1
	a0 = num1
	n = y2 - y1 + 1
	d0 = x1 + y1 - 1
	d = 1
	path1 = a1p(a0, n, d0, d) + a1p(cell(x1 + 1, y2), x2 - x1, x1 + 1 + y2, 1)
	path2 = a1p(a0, x2 - x1 + 1, x1 + y1, 1) + a1p(cell(x2, y1 + 1), y2 - y1, x2 + y1, 1)
	print(path2 - path1 + 1)


t = int(input())
for _ in range(t):
	(a, b, c, d) = list(map(int, input().split()))
	e = c - a
	f = e * (e + 1) // 2
	g = (d - b) * (c - a) + f
	print(g - f + 1)


import os
import sys
if os.path.exists('/mnt/c/Users/Square/square/codeforces'):
	f = iter(open('C.txt').readlines())

	def input():
		return next(f)
else:
	input = lambda : sys.stdin.readline().strip()
fprint = lambda *args: print(*args, flush=True)
import itertools
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	print((x2 - x1) * (y2 - y1) + 1)


t = int(input())
for test in range(t):
	(x, y, a, b) = [int(x) for x in input().split()]
	print((x - a) * (y - b) + 1)


T = int(input())
for i in range(T):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	print((x2 - x1) * (y2 - y1) + 1)


import sys
from collections import *
import math
import bisect

def input():
	return sys.stdin.readline()
for _ in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		summ = (y2 - y1) * (x2 - x1) + 1
		print(summ)


T = int(input())
for _ in range(0, T):
	(x1, y1, x2, y2) = map(int, input().split())
	tt = y2 - y1 + 1 + (x2 - x1 + 1) - 1
	dr = x2 - x1
	dc = y2 - y1
	mn = min(dr, dc)
	t2 = mn - 1
	ans = t2 * (t2 + 1)
	ans += (tt - 2 * mn) * mn
	print(ans + 1)


from math import *
from collections import *
from itertools import *
from bisect import *
from heapq import *
from operator import *
from sys import *
setrecursionlimit(1000000)
d = defaultdict(lambda : 0, {})

def io():
	return map(int, input().split())

def op():
	return list(map(int, input().split()))

def o():
	return int(input())

def r(x):
	if type(x) == int:
		return range(x)
	else:
		return range(len(x))

def kl(con, x=0):
	if x == 0:
		print('Yes') if con else print('No`')
	elif x == 1:
		print('yes') if con else print('no')
	elif x == 2:
		print('YES') if con else print('NO')
MOD = 1000000007
MAX = float('inf')
MIN = -float('inf')
p = input
for _ in range(o()):
	(a, b, c, d) = io()
	(t1, t2) = (c - a, d - b)
	print(t1 * t2 + 1)


import sys
input = sys.stdin.readline
t = int(input())
import math

def f(a, b):
	z2 = min(a - 1, b - 1)
	z4 = math.pow(2, z2)
	return int(z4)
for t1 in range(t):
	(x, y, a, b) = list(map(int, input().split(' ')))
	x -= 1
	y -= 1
	a -= x
	b -= y
	ans = 0
	if a == 1 or b == 1:
		ans = 1
	else:
		ans = 1 + (a - 1) * (b - 1)
	print(ans)


from collections import *
from bisect import *
from math import *
from heapq import *
import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	(x, y, x1, y1) = map(int, input().split())
	print((x1 - x) * (y1 - y) + 1)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	ans = (x2 - x1) * (y2 - y1) + 1
	print(ans, end='\n')


t = int(input())
answer = []
for kek in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	dx = x2 - x1
	dy = y2 - y1
	print(dx * dy + 1)


def a(i, j):
	return (i + j - 1) * (i + j - 2) // 2 + i
mark = []

def bt(x, y, xs, ys, s):
	if x > xs or y > ys:
		return 0
	if x == xs and y == ys:
		res = 1 if not mark[s] else 0
		mark[s] = True
		return res
	t1 = bt(x + 1, y, xs, ys, s + a(x + 1, y))
	t2 = bt(x, y + 1, xs, ys, s + a(x, y + 1))
	return t1 + t2

def solve(x1, y1, x2, y2):
	global mark, res
	res = 0
	mark = [False for i in range(100000)]
	return bt(x1, y1, x2, y2, a(x1, y1))
n = int(input())
for i in range(n):
	(a, b, c, d) = [int(i) for i in input().split()]
	print((c - a) * (d - b) + 1)


t = int(input())
for u in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	c = y2 - y1
	r = x2 - x1
	print(c * r + 1)


test_cases = int(input())
for test_case in range(test_cases):
	(x1, y1, x2, y2) = map(int, input().split(' '))
	dx = x2 - x1
	dy = y2 - y1
	print(dx * dy + 1)


for _ in range(int(input())):
	(N, M, A, B) = map(int, input().split())
	N = A - N
	M = B - M
	print(N * M + 1)


for i in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		print((x2 - x1) * (y2 - y1) + 1)


from sys import stdin
for _ in range(int(stdin.readline())):
	(x1, y1, x2, y2) = map(int, stdin.readline().split())
	r = y2 - y1
	d = x2 - x1
	x = min(r, d)
	print(x ** 2 + abs(d - r) * x + 1)


def sum(v):
	return v * (v - 1) // 2

def sqSum(v):
	return v * (v + 1) * (v + 1 + v) // 6

def val(x, y):
	return sum(x + 1) + x * (y - 1) + sum(y - 1)

def colSum(x1, x2, y):
	return (sum(x2 + 1) - sum(x1) + sqSum(x2) - sqSum(x1 - 1)) // 2 + (x2 - x1 + 1) * sum(y - 1) + (y - 1) * (sum(x2 + 1) - sum(x1))

def rowSum(x, y1, y2):
	return (y2 - y1 + 1) * sum(x + 1) + x * (sum(y2 + 1) - sum(y1) - (y2 - y1 + 1)) + (sqSum(y2) - sqSum(y1 - 1) - 3 * (sum(y2 + 1) - sum(y1)) + 2 * (y2 - y1 + 1)) // 2
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	s = rowSum(x1, y1, y2) + colSum(x1, x2, y2) - val(x1, y2) - colSum(x1, x2, y1) - rowSum(x2, y1, y2) + val(x2, y1)
	print(-s + 1)


import io
import os
import functools
import itertools
import math
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
while t:
	t -= 1
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	if x1 == x2 or y1 == y2:
		print(1)
	else:
		print(1 + (x2 - x1) * (y2 - y1))


import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def numberOfPaths(m, n):
	path = 1
	for i in range(n, m + n - 1):
		path *= i
		path //= i - n + 1
	return path

def solve():
	(x1, y1, x2, y2) = num_input()
	print(abs(x1 - x2) * abs(y1 - y2) + 1)
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	k = min(x2 - x1, y2 - y1)
	l = (k - 1) * k
	r = x2 - x1 + y2 - y1 - 1
	s = r - 2 * (k - 1)
	print(k * s + l + 1)


def mat(a, b, c, d):
	f = (c - a) * (d - b) + 1
	print(f)
	return
t = int(input())
t1 = []
for i in range(t):
	T = input()
	t1 = list(map(int, T.split()))
	mat(t1[0], t1[1], t1[2], t1[3])


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	difx = x2 - x1
	dify = y2 - y1
	sq = difx * dify
	print(sq + 1)


for i in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	ans = 1 + abs(x1 - x2) * abs(y1 - y2)
	print(ans)


from collections import Counter
from collections import OrderedDict
from collections import defaultdict

def SOCountR(mylist):
	return OrderedDict(sorted(Counter(mylist).items(), reverse=True))

def SOCount(mylist):
	return OrderedDict(sorted(Counter(mylist).items()))

def freq_count(mylist):
	return Counter(mylist)
t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	xdiff = abs(x1 - x2)
	ydiff = abs(y1 - y2)
	ans = xdiff * ydiff + 1
	print(ans)


t = int(input())
for i in range(t):
	a = input()
	a1 = a.split()
	x1 = int(a1[0])
	y1 = int(a1[1])
	x2 = int(a1[2])
	y2 = int(a1[3])
	a = y2 - y1
	b = x2 - x1
	sum = 0
	if a == 0:
		if b == 0:
			print(1)
		else:
			print(1)
	elif b == 0:
		print(1)
	else:
		print(b * a + 1)


import io
import os
from collections import Counter, defaultdict, deque

def solve(X1, Y1, X2, Y2):
	if X1 == X2 or Y1 == Y2:
		return 1
	return (Y2 - Y1) * (X2 - X1) + 1
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(X1, Y1, X2, Y2) = [int(x) for x in input().split()]
	ans = solve(X1, Y1, X2, Y2)
	print(ans)


import os
import sys
from io import BytesIO, IOBase

def solution(x1, y1, x2, y2):
	if x1 == x2 or y1 == y2:
		write(1)
		return
	m = x2 - x1
	n = y2 - y1
	write(n * m + 1)

def main():
	for _ in range(r_int()):
		(x1, y1, x2, y2) = r_array()
		solution(x1, y1, x2, y2)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()