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: interview

Starter code:

Solutions:
import sys
input = sys.stdin.readline

t = int(input())
out = []
for _ in range(t):
    a, b, c, d = list(map(int, input().split()))
    dX = c - a
    dY = d - b
    out.append(dX * dY + 1)
    

print('\n'.join(map(str,out)))


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)

import sys
# import math
# from collections import deque
# import heapq
# from math import inf
# from math import gcd

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


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


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():
    #n = int(sys.stdin.readline().strip())
    #n = iinput()
    #n, k = rinput()
    #n, m = rinput()
    #n, m, k = rinput()
    #n, k, m = rinput()
    #q = srlinput()
    #s = input()
    
    x, y, x1, y1 = rinput()
    print(1 + (x - x1) * (y - y1))
    
for  i in range(iinput()):
    main()

t = int(input())

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

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)


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


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


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

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)))


tt = int(input())

for loop in range(tt):

    x1,y1,x2,y2 = list(map(int,input().split()))

    print( (y2-y1) * (x2-x1) + 1 )


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

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)


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

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
return
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 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 _ in range(t):
    a,b,c,d=list(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(mi,ma)
    print(ma-mi+1)
    
    
    
    

    
    


tests = int(input())
for _ in range(tests):
    x1, y1, x2, y2 = map(int, input().split())
    print((x2 - x1) * (y2 - y1) + 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)


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)

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))

    

    


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


def read_ints():
    return list(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)


import sys
import string
input = sys.stdin.readline
import math
#letters = list(string.ascii_lowercase)

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)

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

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


# When angry, count to four; when very angry, swear. Mark Twain
# by : Blue Edge - Create some chaos

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


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)

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 list(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)


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