Screen resolution of Polycarp's monitor is $a \times b$ pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates $(x, y)$ ($0 \le x < a, 0 \le y < b$). You can consider columns of pixels to be numbered from $0$ to $a-1$, and rows — from $0$ to $b-1$.

Polycarp wants to open a rectangular window of maximal size, which doesn't contain the dead pixel. The boundaries of the window should be parallel to the sides of the screen.

Print the maximal area (in pixels) of a window that doesn't contain the dead pixel inside itself.


-----Input-----

In the first line you are given an integer $t$ ($1 \le t \le 10^4$) — the number of test cases in the test. In the next lines you are given descriptions of $t$ test cases.

Each test case contains a single line which consists of $4$ integers $a, b, x$ and $y$ ($1 \le a, b \le 10^4$; $0 \le x < a$; $0 \le y < b$) — the resolution of the screen and the coordinates of a dead pixel. It is guaranteed that $a+b>2$ (e.g. $a=b=1$ is impossible).


-----Output-----

Print $t$ integers — the answers for each test case. Each answer should contain an integer equal to the maximal possible area (in pixels) of a rectangular window, that doesn't contain the dead pixel.


-----Example-----
Input
6
8 8 0 0
1 10 0 3
17 31 10 4
2 1 0 0
5 10 3 9
10 10 4 8

Output
56
6
442
1
45
80



-----Note-----

In the first test case, the screen resolution is $8 \times 8$, and the upper left pixel is a dead pixel. Here you can see one of two possible layouts of the maximal window. [Image]

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
q = int(input())
for u in range(q):
	(a, b, x, y) = [int(i) for i in input().split()]
	if x < a - x - 1:
		c = a - x - 1
	else:
		c = x
	if y < b - y - 1:
		d = b - y - 1
	else:
		d = y
	if c * b > d * a:
		print(c * b)
	else:
		print(d * a)


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


def main():
	for _ in range(int(input())):
		(a, b, x, y) = map(int, input().split())
		A = x * b
		B = (a - x - 1) * b
		C = a * (b - y - 1)
		D = a * y
		if a == 1:
			A = 0
			B = 0
		if b == 1:
			C = 0
			D = 0
		print(max(max(A, B), max(C, D)))
main()


N_SETS = int(input())
for _ in range(N_SETS):
	(h, w, hb, wb) = [int(x) for x in input().split()]
	max_h = max(hb, h - hb - 1)
	max_w = max(wb, w - wb - 1)
	print(max(max_h * max_w, h * max_w, max_h * w))


def solve():
	(a, b, x, y) = map(int, input().split())
	res = max(max(a * y, b * x), max(a * (b - 1 - y), b * (a - 1 - x)))
	print(res)
t = eval(input())
while t:
	solve()
	t -= 1


def calc(a, b, x, y):
	return max(max(x, a - x - 1) * b, max(y, b - y - 1) * a)
N = int(input())
cases = []
for _ in range(N):
	cases.append(map(int, input().split()))
for (a, b, x, y) in cases:
	print(calc(a, b, x, y))


terns = int(input())
for i in range(terns):
	[a, b, x, y] = [int(l) for l in input().split()]
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	arr1 = b * x
	arr2 = b * (a - x - 1)
	arr3 = a * y
	arr4 = a * (b - y - 1)
	print(max(arr1, arr2, arr3, arr4))


n = int(input())
s1 = 0
for i in range(n):
	(a, b, x, y) = map(int, input().split())
	x = max(x, a - 1 - x)
	y = max(y, b - 1 - y)
	c = max(x * b, a * y)
	print(c)


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	x = x + 1
	y = y + 1
	ui = max((x - 1) * y, x * (y - 1), (a - x + 1) * (y - 1), y * (a - x), (x - 1) * (b - y + 1), x * (b - y), (a - x) * (b - y + 1), (a - x + 1) * (b - y), a * (y - 1), b * (x - 1), (a - x) * b, (b - y) * a)
	if ui < 0:
		ui = 0
	print(ui)


t = int(input())
while t > 0:
	(a, b, x, y) = [int(a) for a in input().split()]
	print(max(max(y * a, x * b), max((a - (x + 1)) * b, (b - (y + 1)) * a)))
	t = t - 1


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


import sys
t = int(sys.stdin.readline())
for i in range(t):
	[a, b, x, y] = [int(j) for j in sys.stdin.readline().split()]
	x += 1
	y += 1
	v1 = (a - x) * b
	v2 = (x - 1) * b
	v3 = a * (b - y)
	v4 = a * (y - 1)
	v = max(v1, v2)
	v = max(v, v3)
	v = max(v, v4)
	print(v)


for tc in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	aa = a - x
	aaa = x - 1
	bb = b - y
	bbb = y - 1
	print(max(aa * b, aaa * b, bb * a, bbb * a))


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


t = int(input())
for _ in range(t):
	(a, b, x, y) = list(map(int, input().split()))
	c = [(b - y - 1) * a, (a - x - 1) * b, y * a, x * b]
	print(max(c))


def solve():
	for _ in range(int(input())):
		(a, b, x, y) = map(int, input().split())
		num1 = x * b
		num2 = y * a
		num3 = (a - x - 1) * b
		num4 = (b - y - 1) * a
		print(max(num1, num2, num3, num4))
solve()


from sys import stdin
t = int(stdin.readline())
while t:
	(a, b, x, y) = map(int, stdin.readline().split())
	print(max(a * y, a * (b - y - 1), b * x, b * (a - x - 1)))
	t -= 1


import re
amount_of_data = int(input())
list_a = []
list_b = []
list_x = []
list_y = []
for i in range(amount_of_data):
	string = input()
	nums = re.findall('\\d+', string)
	list_a.append(nums[0])
	list_b.append(nums[1])
	list_x.append(nums[2])
	list_y.append(nums[3])
for index in range(len(list_a)):
	new_list = []
	new_list.append(int(list_y[index]) * int(list_a[index]))
	new_list.append(int(list_x[index]) * int(list_b[index]))
	new_list.append((int(list_b[index]) - int(list_y[index]) - 1) * int(list_a[index]))
	new_list.append((int(list_a[index]) - int(list_x[index]) - 1) * int(list_b[index]))
	print(max(new_list))


import sys
queries = int(sys.stdin.readline())
for query in range(queries):
	(columns, rows, x, y) = map(int, sys.stdin.readline().strip().split())
	x += 1
	y += 1
	var1 = (x - 1) * rows
	var2 = (columns - x) * rows
	var3 = columns * (y - 1)
	var4 = columns * (rows - y)
	print(max(var1, var2, var3, var4))


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	a1 = a * max(b - y - 1, y)
	a2 = b * max(a - x - 1, x)
	print(max(a1, a2))


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


import sys
input = sys.stdin.readline
for ti in range(int(input())):
	(a, b, x, y) = [int(x) for x in input().strip().split()]
	print(max(x * b, a * y, (a - x - 1) * b, a * (b - y - 1)))


t = int(input())
for _ in range(t):
	(a, b, x, y) = [int(s) for s in input().split()]
	r1 = b * x
	r2 = a * y
	r3 = (a - x - 1) * b
	r4 = (b - y - 1) * a
	print(max(r1, r2, r3, r4))


def checker(a, b, x, y):
	p = x if x >= a - 1 - x else a - 1 - x
	q = y if y >= b - 1 - y else b - 1 - y
	(a1, a2) = (p * b, q * a)
	return a1 if a1 >= a2 else a2
for _ in range(int(input())):
	(A, B, X, Y) = [int(i) for i in input().split()]
	print(checker(A, B, X, Y))


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


t = int(input())
for i in range(0, t):
	s = input().split(' ')
	a = int(s[0])
	b = int(s[1])
	x = int(s[2])
	y = int(s[3])
	mas = [(a - x - 1) * b, x * b, (b - y - 1) * a, y * a]
	print(max(mas))


def machine(li):
	listresult = []
	f = li[0]
	c = li[1]
	x = li[2]
	y = li[3]
	r = calcrigth(c, y)
	l = calcleft(c, r)
	d = calcdown(f, x)
	u = calcup(f, d)
	tr = f * r
	listresult.append(tr)
	tl = f * l
	listresult.append(tl)
	td = c * d
	listresult.append(td)
	tu = c * u
	listresult.append(tu)
	return max(listresult)

def calcrigth(c, y):
	return c - y - 1

def calcleft(c, r):
	return c - r - 1

def calcup(f, d):
	return f - d - 1

def calcdown(f, x):
	return f - x - 1
milist = []
listint = []
t = int(input())
for i in range(t):
	listnum = []
	milist = input().split()
	for nums in milist:
		listnum.append(int(nums))
	listint.append(listnum)
for i in range(t):
	print(machine(listint[i]))


for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	k = a * d
	l = b * c
	m = b * (a - c - 1)
	n = a * (b - d - 1)
	print(max(k, l, m, n))


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	a1 = x * b
	a2 = b * (a - x - 1)
	a3 = a * y
	a4 = a * (b - y - 1)
	print(max(a1, a2, a3, a4))


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


ilosc = int(input())
tab = []
for i in range(ilosc):
	(a, b, xa, xb) = [int(x) for x in input().split()]
	tab.append(max((a - (xa + 1)) * b, xb * a, xa * b, (b - (xb + 1)) * a))
for j in range(len(tab)):
	print('\n', tab[j])


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(A, B, X, Y) = [int(x) for x in input().split()]
		ma = 0
		ma = max(X * B, ma)
		ma = max(Y * A, ma)
		ma = max((A - X - 1) * B, ma)
		ma = max((B - Y - 1) * A, ma)
		print(ma)
main()


t = int(input())
while t > 0:
	t = t - 1
	(a, b, x, y) = map(int, input().split())
	one = y * a
	two = x * b
	three = (a - 1 - (x + 1) + 1) * b
	four = (b - 1 - (y + 1) + 1) * a
	print(max(one, two, three, four))


for test_c in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	if a + 1 <= x / 2:
		a = x - a - 1
	if b + 1 <= y / 2:
		b = y - b - 1
	if a * y > b * x:
		print(a * y)
	else:
		print(b * x)


import math
import sys
input = sys.stdin.readline

def print(x, end='\n'):
	sys.stdout.write(str(x) + end)
t = int(input())
while t:
	t -= 1
	(a, b, x, y) = map(int, input().split())
	area = max(x * b, a * y)
	area1 = max((a - x - 1) * b, a * (b - y - 1))
	print(max(area, area1))


t = int(input())
while t:
	t = t - 1
	(a, b, x, y) = map(int, input().split())
	if x >= a // 2:
		l1 = x
	else:
		l1 = a - x - 1
	area1 = l1 * b
	if y >= b // 2:
		l2 = y
	else:
		l2 = b - y - 1
	area2 = l2 * a
	print(max(area1, area2))


t = int(input())
ans = []
for i in range(t):
	ls = [int(ls) for ls in input().split()]
	(a, b, x, y) = (ls[0], ls[1], ls[2], ls[3])
	ans.append(max(a * (b - 1 - y), a * y, b * (a - x - 1), b * x))
for i in ans:
	print(i)


number_of_testcase = int(input())

def greater(m, n):
	if m > n:
		return m
	else:
		return n
for i in range(number_of_testcase):
	(a, b, x, y) = list(map(int, input().split(' ')))
	larger_x = greater(a - 1 - x, x)
	larger_y = greater(b - 1 - y, y)
	result = greater(larger_x * b, larger_y * a)
	print(result)


t = int(input())
while t > 0:
	(a, b, x, y) = map(int, input().split())
	s1 = x * b
	s2 = (a - x - 1) * b
	s3 = y * a
	s4 = (b - y - 1) * a
	ans = max(s1, s2, s3, s4)
	print(ans)
	t -= 1


import sys

def main():
	(a, b, x, y) = [int(i) for i in sys.stdin.readline().split()]
	print(max(max(y * a, (b - y - 1) * a), max(x * b, (a - x - 1) * b)))
for test in range(int(sys.stdin.readline())):
	main()


n = int(input())
for i in range(n):
	(a, b, x, y) = map(int, input().split())
	v = (a - x - 1) * b
	v1 = (b - y - 1) * a
	v2 = x * b
	v3 = y * a
	c = max(v, v1, v2, v3)
	print(c)


def f():
	l1 = input().split(' ')
	a = int(l1[0])
	b = int(l1[1])
	x = int(l1[2]) + 1
	y = int(l1[3]) + 1
	m = max((a - x) * b, (x - 1) * b, (b - y) * a, (y - 1) * a)
	print(m)
	return 0
row = int(input())
for r in range(row):
	f()


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


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


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


t = int(input())
for T in range(t):
	(a, b, x, y) = list(map(int, input().split()))
	a1 = a2 = a3 = a4 = 0
	a1 = x * b
	a2 = (a - (x + 1)) * b
	a3 = y * a
	a4 = (b - (y + 1)) * a
	print(max(a1, a2, a3, a4))


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


testCase = int(input())
for i1 in range(testCase):
	parameters = list(map(int, input().split()))
	parameters[0] -= 1
	parameters[1] -= 1
	area = [0] * 4
	area[0] = (parameters[0] + 1) * (parameters[1] - parameters[3])
	area[1] = (parameters[0] + 1) * parameters[3]
	area[2] = (parameters[1] + 1) * (parameters[0] - parameters[2])
	area[3] = (parameters[1] + 1) * parameters[2]
	print(max(area))


def cal(y1, x1, y2, x2):
	if y1 <= y2 and x1 <= x2:
		return (y2 - y1 + 1) * (x2 - x1 + 1)
	else:
		return 0
t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	ans = 0
	ans = max(ans, cal(0, 0, x - 1, b - 1))
	ans = max(ans, cal(x + 1, 0, a - 1, b - 1))
	ans = max(ans, cal(0, 0, a - 1, y - 1))
	ans = max(ans, cal(0, y + 1, a - 1, b - 1))
	print(ans)


for _ in range(int(input())):
	(a, b, x, y) = [int(i) for i in input().split()]
	l = (b - (y + 1)) * a
	r = y * a
	d = (a - (x + 1)) * b
	u = x * b
	print(max([l, r, d, u]))


n = int(input())
for i in range(n):
	a = str(input())
	a = a.split(' ')
	s1 = int(a[0]) * int(a[3])
	s2 = int(a[1]) * int(a[2])
	s3 = (int(a[1]) - int(a[3]) - 1) * int(a[0])
	s4 = (int(a[0]) - int(a[2]) - 1) * int(a[1])
	print(max(s1, s2, s3, s4))


def area(data):
	lx = data[0]
	ly = data[1]
	x = data[2] + 1
	y = data[3] + 1
	if lx - x < x:
		ans1 = (x - 1) * ly
	else:
		ans1 = (lx - x) * ly
	if ly - y < y:
		ans2 = (y - 1) * lx
	else:
		ans2 = (ly - y) * lx
	return max(ans1, ans2)
n = int(input())
data = []
answer = []
for i in range(0, n):
	data = list(map(int, input().split()))
	answer.append(area(data))
for i in range(0, len(answer)):
	print(answer[i])


import sys

def techo(num):
	if float(num) - int(num) != 0:
		return int(num) + 1
	else:
		return num
t = int(input())
for case in range(t):
	line = sys.stdin.readline().strip().split(' ')
	a = int(line[0])
	b = int(line[1])
	x = int(line[2])
	y = int(line[3])
	if x + 1 > techo(float(a) / 2):
		if y + 1 > techo(float(b) / 2):
			if x * b > a * y:
				print(x * b)
			else:
				print(a * y)
		elif x * b > a * (b - (y + 1)):
			print(x * b)
		else:
			print(a * (b - (y + 1)))
	elif y + 1 > techo(float(b) / 2):
		if (a - x - 1) * b > a * y:
			print((a - x - 1) * b)
		else:
			print(a * y)
	elif (a - 1 - x) * b > a * (b - 1 - y):
		print((a - 1 - x) * b)
	else:
		print(a * (b - 1 - y))


T = int(input())
for i in range(0, T):
	ls = list(map(int, input().split()))
	w1 = max(ls[1] - ls[3] - 1, ls[3])
	l1 = max(ls[0] - ls[2] - 1, ls[2])
	print(max(w1 * ls[0], l1 * ls[1]))


test_cases = int(input())
for test in range(test_cases):
	(w, l, x, y) = input().split()
	w = int(w)
	l = int(l)
	x = int(x)
	y = int(y)
	width_choice = max(w - x - 1, x - 0)
	length_choice = max(l - y - 1, y - 0)
	best_area = max(width_choice * l, length_choice * w)
	print(best_area)


for _ in range(int(input())):
	tmp = [int(x) for x in input().split()]
	(a, b, x, y) = (tmp[0], tmp[1], tmp[2], tmp[3])
	tmpl = [x * y, (a - x) * y, x * (b - y), (a - x - 1) * (b - y - 1), a * y, a * (b - (y + 1)), x * b, (a - x - 1) * b]
	print(max(tmpl))


from sys import stdin

def solve(a, b, x, y):
	ans = max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a)
	return ans

def main():
	t = int(stdin.readline().strip())
	for _ in range(t):
		(a, b, x, y) = map(int, stdin.readline().strip().split())
		print(solve(a, b, x, y))
main()


import sys
input = sys.stdin.readline
from collections import defaultdict as dd
t = int(input())
while t:
	(x, y, a, b) = map(int, input().split())
	a1 = b * x
	a2 = a * y
	a3 = (x - a - 1) * y
	a4 = (y - b - 1) * x
	print(max(a1, a2, a3, a4))
	t -= 1


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	(x, y) = (x + 1, y + 1)
	if a == 1:
		print(max(b - y, y - 1))
	elif b == 1:
		print(max(a - x, x - 1))
	else:
		r = a * (y - 1)
		r = max(r, b * (x - 1))
		r = max(r, (b - y) * a)
		r = max(r, (a - x) * b)
		print(r)


t = int(input())
for _ in range(t):
	(a, b, x, y) = [int(x) for x in input().split()]
	c = max(x, a - x - 1) * b
	d = a * max(y, b - y - 1)
	print(max(c, d))


t = int(input())
for t1 in range(t):
	line = input()
	(a, b, x, y) = (int(x) for x in line.split())
	options = [a * (b - y - 1), b * (a - x - 1), a * y, b * x]
	print(max(options))


def main():
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	up = (x - 1) * b
	down = (y - 1) * a
	if a - x > 0:
		left = (a - x) * b
	else:
		left = 0
	if b - y > 0:
		right = (b - y) * a
	else:
		right = 0
	print(max(up, down, left, right))
	return

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


for _ in range(int(input())):
	(a, b, y, x) = map(int, input().split())
	lc = y - 0
	if y == 0:
		lr = 0
	else:
		lr = b
	if y == a - 1:
		rr = 0
	else:
		rr = b
	rc = a - 1 - y
	if x == b - 1:
		dwc = 0
		dwr = 0
	else:
		dwc = a
		dwr = b - 1 - x
	if x == 0:
		upr = 0
		upc = 0
	else:
		upr = x - 0
		upc = a
	print(max(lr * lc, rr * rc, dwr * dwc, upr * upc))


def get_result(length, height, x, y):
	l1 = x - 1
	l2 = length - x
	h1 = height - y
	h2 = y - 1
	s1 = h1 * l1
	s2 = h1 * l2
	s3 = h2 * l1
	s4 = h2 * l2
	return max(s1 + s2 + h1, s1 + s3 + l1, s3 + s4 + h2, s2 + s4 + l2)
count = int(input())
results = []
for i in range(count):
	(a, b, c, d) = map(int, input().split())
	result = get_result(a, b, c + 1, d + 1)
	results.append(result)
for i in results:
	print(i)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
for _ in range(get_int()):
	(a, b, x, y) = get_int_list()
	area = max((a - x - 1) * b, x * b, y * a, (b - y - 1) * a)
	print(area)


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


t = int(input())
while t > 0:
	(a, b, x, y) = map(int, input().split())
	ans = max((a - x - 1) * b, x * b, (b - y - 1) * a, y * a)
	print(ans)
	t -= 1


def solve(a, b, x, y):
	i = max(x, a - 1 - x)
	ans = i * b
	i = max(y, b - 1 - y)
	ans = max(ans, i * a)
	print(ans)

def main():
	inp = lambda : [int(x) for x in input().split()]
	tc = int(input())
	for _ in range(tc):
		(a, b, x, y) = inp()
		solve(a, b, x, y)
main()


test = int(input())
for x in range(test):
	(x, y, dx, dy) = map(int, input().split())
	left = dx * y
	bottom = (x - 1 - dx) * y
	right = (y - 1 - dy) * x
	top = dy * x
	print(max(top, left, right, bottom))


import sys
import math
from collections import defaultdict
from collections import deque
from itertools import combinations
from itertools import permutations
input = lambda : sys.stdin.readline().rstrip()
read = lambda : list(map(int, input().split()))
go = lambda : 1 / 0

def write(*args, sep='\n'):
	for i in args:
		sys.stdout.write('{}{}'.format(i, sep))
INF = float('inf')
MOD = int(1000000000.0 + 7)
YES = 'YES'
NO = 'NO'
for _ in range(int(input())):
	try:
		(a, b, x, y) = read()
		up = y * a
		down = (b - y - 1) * a
		left = x * b
		right = (a - x - 1) * b
		print(max([up, down, left, right]))
	except ZeroDivisionError:
		continue
	except Exception as e:
		print(e)
		continue


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


import sys, math, cmath, time
start_time = time.time()

def solve():
	(a, b, x, y) = invr()
	q = max(a - x - 1, x)
	w = max(b - y - 1, y)
	print(max(q * b, w * a))

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 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 counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 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

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

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


t = int(input())
while t:
	t += -1
	(a, b, x, y) = map(int, input().split())
	a1 = b * x
	a2 = a * y
	a3 = b * (a - x - 1)
	a4 = a * (b - y - 1)
	print(max(a1, a2, a3, a4))


t = int(input())
u = []
for i in range(0, t):
	a = [int(i) for i in input().split()]
	s1 = a[2] * a[1]
	s2 = a[3] * a[0]
	s3 = (a[0] - a[2] - 1) * a[1]
	s4 = (a[1] - a[3] - 1) * a[0]
	d = [s1, s2, s3, s4]
	u.append(max(d))
for i in u:
	print(i)


kl = int(input())
for l in range(kl):
	(a, b, x, y) = [int(i) for i in input().split()]
	print(max(a * y, a * (b - y - 1), b * x, b * (a - x - 1)))


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


l = input()
k = int(l)
for i in range(0, k):
	(a, b, x, y) = map(int, input().split())
	x = x + 1
	y = y + 1
	r1 = (x - 1) * b
	r2 = a * (b - y)
	r3 = (y - 1) * a
	r4 = (a - x) * b
	print(max(max(r1, r2), max(r3, r4)))


def dead_pixel(a, b, x, y):
	h = a * max(y, b - y - 1)
	v = b * max(x, a - x - 1)
	return max(h, v)
t = int(input())
for _ in range(t):
	print(dead_pixel(*map(int, input().split())))


t = int(input())
test_list = []
ans = []
for i in range(0, t):
	case = input()
	test_list.append(case.split())
for j in test_list:
	a = int(j[0])
	b = int(j[1])
	x = int(j[2])
	y = int(j[3])
	first = a * y
	second = b * x
	third = a * (b - (y + 1))
	fourth = b * (a - (x + 1))
	max_list = [first, second, third, fourth]
	ans.append(max(max_list))
for i in ans:
	print(i)


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


t = int(input())
for i in range(t):
	w = list(map(int, input().split(' ')))
	maxi = 0
	area = w[0] * w[3]
	if area > maxi:
		maxi = area
	area = w[1] * w[2]
	if area > maxi:
		maxi = area
	area = w[0] * (w[1] - w[3] - 1)
	if area > maxi:
		maxi = area
	area = w[1] * (w[0] - w[2] - 1)
	if area > maxi:
		maxi = area
	print(maxi)


t = int(input())
for _ in range(t):
	(a, b, x, y) = list(map(int, input().split()))
	a1 = (a - x - 1) * b
	a2 = (b - y - 1) * a
	a3 = y * a
	a4 = x * b
	if a3 == a * b:
		a3 = 0
	if a4 == b * a:
		a4 = 0
	g = max(a1, a2, a3, a4)
	print(g)


def perimeter(p1, p2):
	d1 = p2[0] - p1[0] + 1
	d2 = p2[1] - p1[1] + 1
	return d1 * d2

def main():
	no_of_screens = int(input())
	for _ in range(no_of_screens):
		(a, b, x, y) = [int(elem) for elem in input().split()]
		x += 1
		y += 1
		left_up = (1, 1)
		left_down = (0, b)
		right_up = (a, 0)
		right_down = (a, b)
		above_dead_pixel = (left_up, (a, y - 1))
		below_dead_pixel = ((1, y + 1), right_down)
		right_dead_pixel = ((x + 1, 1), right_down)
		left_dead_pixel = (left_up, (x - 1, b))
		p1 = perimeter(*above_dead_pixel)
		p2 = perimeter(*below_dead_pixel)
		p3 = perimeter(*right_dead_pixel)
		p4 = perimeter(*left_dead_pixel)
		print(max([p1, p2, p3, p4]))
main()


import math
numberTests = int(input())
for n in range(numberTests):
	line = input()
	maximous = []
	(height, width, y, x) = map(int, line.split())
	distanceDerecha = abs(width - x - 1)
	maximous.append(distanceDerecha * height)
	maximous.append(x * height)
	distanciaAbajo = abs(height - y - 1)
	maximous.append(distanciaAbajo * width)
	maximous.append(y * width)
	print(max(maximous))


T = int(input().strip())
debug = False
for t in range(T):
	(a, b, x, y) = map(int, input().split())
	if x == 0 and y == 0 or (x == a - 1 and y == 0) or (x == a - 1 and y == b - 1) or (x == 0 and y == b - 1):
		print(max((a - 1) * b, a * (b - 1)))
	elif (x == 0 or x == a - 1) and 0 < y < b - 1:
		print(max((a - 1) * b, a * y, a * (b - (y + 1))))
	elif (y == 0 or y == b - 1) and 0 < x < a - 1:
		print(max(a * (b - 1), b * x, b * (a - (x + 1))))
	else:
		print(max(a * y, a * (b - (y + 1)), b * x, b * (a - (x + 1))))


def max_area(a, b, x, y):
	return max([(a - x - 1) * b, a * (b - y - 1), x * b, y * a])
for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	print(max_area(a, b, x, y))


from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
from math import *
from collections import defaultdict as dd, deque

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

def mdata():
	return map(int, data().split())
for i in range(int(input())):
	(a, b, x, y) = mdata()
	print(max(max(a - x - 1, x) * b, max(b - y - 1, y) * a))


import sys
n = int(sys.stdin.readline())
for _ in range(n):
	(a, b, x, y) = [int(d) for d in sys.stdin.readline().split()]
	s = max([x * b, (a - x - 1) * b, a * y, a * (b - y - 1)])
	print(s)


for ul in range(int(input())):
	(a, b, x, y) = [int(x) for x in input().split()]
	a1 = b * (x - 0)
	a2 = b * (a - x - 1)
	a3 = a * (y - 0)
	a4 = a * (b - y - 1)
	print(max(a1, a2, a3, a4))


import math, collections, sys
input = sys.stdin.readline

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


t = int(input())
while t > 0:
	(m, n, x, y) = [int(x) for x in input().split(' ')]
	x += 1
	y += 1
	a = (y - 1) * m
	b = (n - y) * m
	c = (x - 1) * n
	d = (m - x) * n
	if a > b and a > c and (a > d):
		print(a)
	elif b > c and b > d:
		print(b)
	elif c > d:
		print(c)
	else:
		print(d)
	t -= 1


t = int(input())
result = []
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	k = max(b * x, b * (a - x - 1), a * y, a * (b - y - 1))
	result.append(k)
for i in range(t):
	print(result[i])


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

def gift():
	for _ in range(t):
		(a, b, x, y) = [int(x) for x in input().split()]
		s1 = a * (b - y - 1)
		s2 = a * y
		s3 = b * (a - x - 1)
		s4 = b * x
		yield max([s1, s2, s3, s4])
t = int(input())
ans = gift()
print(*ans, sep='\n')


for _ in range(int(input())):
	(r, c, x, y) = map(int, input().split())
	l = [(c - 1 - y) * r, y * r, x * c, (r - 1 - x) * c]
	print(max(l))


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


t = int(input())
for you in range(t):
	l = input().split()
	a = int(l[0])
	b = int(l[1])
	x = int(l[2])
	y = int(l[3])
	x = x + 1
	y = y + 1
	print(max((x - 1) * b, (a - x) * b, a * (y - 1), a * (b - y)))


for _ in [*open(0)][1:]:
	(a, b, x, y) = map(int, _.split())
	print(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))


t = int(input())
for _ in range(t):
	(a, b, x, y) = list(map(int, input().split()))
	l = (a - x - 1) * b
	r = x * b
	u = y * a
	d = (b - y - 1) * a
	print(f'{max(l, r, u, d)}')


n = int(input())
for i in range(n):
	(a, b, x, y) = map(int, input().split())
	da = a - x - 1
	if da < x:
		da = x
	db = b - y - 1
	if db < y:
		db = y
	if da * b >= a * db:
		print(da * b)
	else:
		print(a * db)


from sys import stdin

def main():
	k = [int(i) for i in stdin.read().split()]
	t = k[0]
	for i in range(t):
		(a, b, x, y) = (k[1 + i * 4], k[2 + i * 4], k[3 + i * 4], k[4 + i * 4])
		print(max(b * max(x, a - x - 1), a * max(y, b - y - 1)))
main()


for _ in range(int(input())):
	(a, b, x, y) = [int(i) for i in input().split()]
	x += 1
	y += 1
	m1 = 0
	m2 = 0
	if a == 1:
		m1 = max(y - 1, b - y)
	elif b == 1:
		m2 = max(x - 1, a - x)
	else:
		m1 = a * max(y - 1, b - y)
		m2 = b * max(x - 1, a - x)
	print(max(m1, m2))


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


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	total = a * b
	left = x * b
	right = total - left - b
	down = a * y
	up = total - down - a
	print(max(left, right, down, up))


def matchArea(w, h, x, y):
	xArea = x * h if x + 1 > w / 2 else (w - x - 1) * h
	yArea = y * w if y + 1 > h / 2 else (h - y - 1) * w
	return xArea if xArea > yArea else yArea
n = int(input())
s = ''
for i in range(n):
	(a, b, x, y) = map(int, input().split(' '))
	s += str(matchArea(a, b, x, y)) + '\n'
print(s[0:-1])


for _ in range(int(input())):
	(n, m, a, b) = map(int, input().split())
	if a >= n / 2:
		a = n - a - 1
	if b >= m / 2:
		b = m - b - 1
	if (n - a - 1) * m >= (m - b - 1) * n:
		print((n - a - 1) * m)
	else:
		print((m - b - 1) * n)


n = int(input())
for i in range(n):
	(a, b, x, y) = map(int, input().split())
	if x >= a // 2:
		c = a - x
		c = a - c
		a1 = c * b
	if x < a // 2:
		c = a - x - 1
		a1 = c * b
	if y < b // 2:
		c = b - y - 1
		a2 = c * a
	if y >= b // 2:
		c = y
		a2 = c * a
	print(max(a1, a2))


for _ in range(int(input())):
	lst = list(map(int, input().split(' ')))
	(a, b, x, y) = lst
	m = [a * (b - y - 1), a * y, b * x, b * (a - x - 1)]
	print(max(m))


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


import atexit
import io
import sys
import math
from collections import defaultdict, Counter
t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	print(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))


for _ in range(int(input())):
	(x, y, px, py) = [int(i) for i in input().split()]
	mx_p = 0
	if x > 0:
		if y * px > mx_p:
			mx_p = y * px
		if x > px + 1:
			p = y * (x - (px + 1))
			if p > mx_p:
				mx_p = p
	if y > 0:
		if x * py > mx_p:
			mx_p = x * py
		if y > py + 1:
			p = x * (y - (py + 1))
			if p > mx_p:
				mx_p = p
	print(mx_p)


import sys
from collections import defaultdict, deque
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def a():
	ans = ''
	for _ in range(read()[0]):
		(a, b, x, y) = read()
		x += 1
		y += 1
		ans += str(max((a - x) * b, (x - 1) * b, a * (b - y), a * (y - 1))) + '\n'
	print(ans)
a()


def solve():
	(R, C, x, y) = map(int, input().split())
	mx = max(R * y, x * C)
	if y + 1 != C:
		mx = max(mx, R * (C - y - 1))
	if x + 1 != R:
		mx = max(mx, (R - x - 1) * C)
	print(mx)
t = int(input())
for _ in range(t):
	solve()


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


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


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


T = int(input())
while T > 0:
	q = 0
	x = [int(x) for x in input().split()]
	a = int(x[0])
	b = int(x[1])
	c = int(x[2])
	d = int(x[3])
	c = c + 1
	d = d + 1
	ans = max(a * (d - 1), a * (b - d))
	ans = max(ans, (a - c) * b)
	ans = max(ans, (c - 1) * b)
	print(ans)
	T = T - 1


t = int(input())
area = 4 * [0]
for iteration in range(t):
	inp = input().split()
	a = int(inp[0])
	b = int(inp[1])
	x = int(inp[2])
	y = int(inp[3])
	area[0] = x * b
	area[1] = b * (a - x - 1)
	area[2] = a * y
	area[3] = a * (b - y - 1)
	print(max(area))


num_tries = int(input())
for i in range(num_tries):
	(a, b, x, y) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	max_area = max((b - y - 1) * a, y * a, x * b, (a - x - 1) * b)
	print(max_area)


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

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

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

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
			n = n - 1
		else:
			a = a * a
			n = n >> 1
	return r

def solve():
	(a, b, x, y) = mp()
	z = max(max(x, a - 1 - x) * b, max(y, b - 1 - y) * a)
	pr(z)
for _ in range(inp()):
	solve()


t = int(input())
for _ in range(t):
	area = 0
	inpt = input()
	num = list(map(int, inpt.split()))
	a = num[0]
	b = num[1]
	x = num[2]
	y = num[3]
	if (a - x - 1) * b >= (b - y - 1) * a and (a - x - 1) * b >= a * y and ((a - x - 1) * b >= b * x):
		print((a - x - 1) * b)
		continue
	elif (b - y - 1) * a >= (a - x - 1) * b and (b - y - 1) * a >= a * y and ((b - y - 1) * a >= b * x):
		print((b - y - 1) * a)
		continue
	elif a * y >= (a - x - 1) * b and a * y >= (b - y - 1) * a and (a * y >= b * x):
		print(a * y)
		continue
	else:
		print(b * x)
		continue


import sys, collections, math, itertools, random, bisect
INF = sys.maxsize

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

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

def input():
	return sys.stdin.readline().strip()
mod = int(1000000000.0 + 7)
for _ in range(int(input())):
	(a, b, x, y) = get_ints()
	print(max(max(x, a - 1 - x) * b, a * max(y, b - y - 1)))


case = int(input())
for i in range(case):
	(a, b, x, y) = (int(v) for v in input().split())
	print(max(x * b, (a - 1 - x) * b, a * y, a * (b - 1 - y)))


t = int(input())
result = []
for _ in range(t):
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	areaArr = [(a - x) * b, a * (b - y), (x - 1) * b, a * (y - 1)]
	result.append(max(areaArr))
for x in result:
	print(x)


def s():
	(a, b, x, y) = [int(x) for x in input().split(' ')]
	res_col = max(a - 1 - x, x)
	res_row = max(b - 1 - y, y)
	print(max(res_col * b, res_row * a))
t = int(input())
for i in range(t):
	s()


import sys
input = sys.stdin.readline
n = int(input())
while n:
	n -= 1
	(a, b, x, y) = map(int, input().split())
	rv = max(x - 0, a - 1 - x)
	cv = max(y - 0, b - 1 - y)
	print(max(rv * b, cv * a))


import sys
import math

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()]
t = read_int()
for i in range(t):
	(a, b, x, y) = read_int_line()
	l = []
	l.append(x * b)
	l.append(y * a)
	l.append((a - 1 - x) * b)
	l.append(a * (b - y - 1))
	print(max(l))


t = int(input())
for i in range(t):
	(a, b, x, y) = list(map(int, input().split()))
	x1 = max(x, a - x - 1)
	ans1 = x1 * b
	y1 = max(y, b - y - 1)
	ans2 = y1 * a
	print(max(ans1, ans2))


for ti in range(int(input())):
	(a, b, x, y) = [int(x) for x in input().strip().split()]
	print(max(x * b, a * y, (a - x - 1) * b, a * (b - y - 1)))


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	if x == 0 and y == 0:
		print(max((a - 1) * b, a * (b - 1)))
		continue
	a1 = x * b
	a2 = a * abs(b - y - 1)
	a3 = b * abs(a - x - 1)
	a4 = a * y
	print(max(a1, a2, a3, a4))


n = int(input())
while n > 0:
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	x = int(s[2])
	y = int(s[3])
	a1 = x * b
	a2 = (a - x - 1) * b
	a3 = a * y
	a4 = a * (b - y - 1)
	ma1 = max(a1, a2, a3, a4)
	print(ma1)
	n -= 1


a = int(input())
arr = []
for i in range(a):
	arr = [int(x) for x in input().split()]
	tx = arr[0]
	ty = arr[1]
	x = arr[2]
	y = arr[3]
	temp = [x * ty, (tx - x - 1) * ty, tx * y, tx * (ty - y - 1)]
	print(max(temp))


t = int(input())
for i in range(t):
	(m, n, x, y) = map(int, input().split())
	d = []
	d.append(x * n)
	d.append((m - 1 - x) * n)
	d.append(m * y)
	d.append(m * (n - y - 1))
	print(max(d))


from math import inf
t = int(input())
for q in range(t):
	(a, b, x, y) = [int(i) for i in input().split()]
	print(max(x * b, (a - x - 1) * b, a * (b - y - 1), a * y))


def calcul_area_max():
	l = list(map(int, input().split(' ')))
	area_max = max(l[2] * l[1], (l[1] - (l[3] + 1)) * l[0], (l[0] - (l[2] + 1)) * l[1], l[3] * l[0])
	print(area_max)
for _ in range(int(input())):
	calcul_area_max()


import math
n = int(input())
for z in range(n):
	(a, b, x, y) = map(int, input().split())
	print(max(x * b, (a - x - 1) * b, a * y, a * (b - y - 1)))


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


a = int(input())
for i in range(a):
	arr = [int(x) for x in input().split()]
	(a, b, x, y) = (arr[0], arr[1], arr[2], arr[3])
	arr = [x * b, (a - x - 1) * b, y * a, (b - y - 1) * a]
	arr.sort()
	print(arr[-1])


n = int(input())
for _ in range(n):
	(a, b, x, y) = map(int, input().split())
	I = x * b
	II = a * y
	III = (a - x - 1) * b
	IV = a * (b - y - 1)
	print(max(I, II, III, IV))


def blackPoint():
	(a, b, x, y) = list(map(int, input().split()))
	diffX = max(x, a - x - 1)
	diffY = max(y, b - 1 - y)
	m1 = diffX * b
	m2 = diffY * a
	print(max(m1, m2))
t = int(input())
for i in range(t):
	blackPoint()


n = input
for _ in [0] * int(n()):
	s = list(map(int, n().split()))
	a = s[0]
	b = s[1]
	x = s[2]
	y = s[3]
	a1 = (b - (y + 1)) * a
	a2 = y * a
	a3 = x * b
	a4 = (a - (x + 1)) * b
	print(max(a1, a2, a3, a4))


def main(a, b, x, y):
	sol = max(max(x, a - x - 1) * b, max(y, b - y - 1) * a)
	print(sol)
n = int(input())
for _ in range(n):
	lst = list(map(int, input().split()))
	(a, b, x, y) = (lst[0], lst[1], lst[2], lst[3])
	main(a, b, x, y)


p = []
n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	a = max(l[0] - l[2] - 1, l[0] - (l[0] - l[2]))
	b = max(l[1] - l[3] - 1, l[1] - (l[1] - l[3]))
	(a, b) = (a * l[1], b * l[0])
	k = max(a, b)
	p.append(k)
for j in p:
	print(j)


from sys import stdin, stdout
t = int(stdin.readline().strip())
for _ in range(t):
	(a, b, x, y) = map(int, stdin.readline().split())
	ans = max(max(x, a - x - 1) * b, max(y, b - y - 1) * a)
	stdout.write('{}\n'.format(ans))


t = int(input())
for _ in range(t):
	x = list(map(int, input().split()))
	a = x[0]
	b = x[1]
	X = x[2]
	Y = x[3]
	y = [(a - X - 1) * b, X * b, (b - Y - 1) * a, Y * a]
	print(max(y))


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	s1 = max(x, a - x - 1)
	s2 = max(y, b - y - 1)
	print(max(s1 * b, s2 * a))


for _ in range(int(input())):
	ins = [int(x) for x in input().split()]
	(a, b, x, y) = (ins[0], ins[1], ins[2] + 1, ins[3] + 1)
	r = (a - x) * b
	l = (x - 1) * b
	u = (b - y) * a
	d = (y - 1) * a
	print(max(max(l, r), max(u, d)))


for tin in range(int(input())):
	(m, n, b, a) = map(int, input().split())
	x = (b - 1) * (a - 1)
	y = (n - a - 1) * (b - 1)
	z = (m - b - 1) * (a - 1)
	c = (n - b - 1) * (m - a - 1)
	d = (m - b - 1) * n
	e = (n - a - 1) * m
	f = b * n
	g = a * m
	print(max(x, y, z, c, d, e, f, g))


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
from heapq import heapify, heappop, heappush

def RL():
	return 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 = 1000000007
INF = float('inf')

def main():
	for _ in range(N()):
		(a, b, x, y) = RL()
		(x, y) = (x + 1, y + 1)
		print(max([a * (y - 1), a * (b - y), b * (x - 1), b * (a - x)]))
main()


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


n = int(input())
for j in range(n):
	(a, b, x, y) = map(int, input().split())
	x = x
	y = y
	xmax = max(a - x, x + 1) - 1
	ymax = max(b - y, y + 1) - 1
	print(max(a * ymax, xmax * b))


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


t = int(input())
for test in range(t):
	(a, b, x, y) = [int(x) for x in input().split()]
	c_x = a - x - 1
	c_y = b - y - 1
	print(max(a * y, b * x, a * c_y, b * c_x))


n = int(input())
c = 0
l1 = []
while c < n:
	l = list(map(int, input().split()))
	l[2] = l[2] + 1
	l[3] = l[3] + 1
	l1.append(max(list([(l[2] - 1) * l[1], (l[3] - 1) * l[0], (l[0] - l[2]) * l[1], (l[1] - l[3]) * l[0]])))
	c = c + 1
for i in l1:
	print(i)


test = int(input())
for i in range(test):
	(a, b, x, y) = map(int, input().split())
	max_len = max(x, a - x - 1)
	area1 = max_len * b
	max_width = max(y, b - y - 1)
	area2 = max_width * a
	area = max(area1, area2)
	print(f'{area}\n')


t = int(input())
abxy = [list(map(int, input().split())) for _ in range(t)]
for abxyi in abxy:
	ai = abxyi[0]
	bi = abxyi[1]
	xi = abxyi[2]
	yi = abxyi[3]
	amax = max(xi, ai - xi - 1)
	bmax = max(yi, bi - yi - 1)
	print(max(amax * bi, ai * bmax))


n = int(input())
for a in range(n):
	coords = list(map(int, input().split()))
	if coords[0] > 1:
		side = min(coords[2] + 1, coords[0] - coords[2]) * coords[1]
	else:
		side = coords[0] * coords[1]
	if coords[1] > 1:
		vert = min(coords[3] + 1, coords[1] - coords[3]) * coords[0]
	else:
		vert = coords[0] * coords[1]
	total = coords[0] * coords[1] - min(vert, side)
	print(total)


def solve(a, b, x, y):
	area1 = a * y
	area2 = a * (b - y - 1)
	area3 = b * x
	area4 = b * (a - x - 1)
	return max(area1, area2, area3, area4)
T = int(input())
for t in range(T):
	(a, b, x, y) = tuple(map(int, input().split()))
	print(solve(a, b, x, y))


n = int(input())
for i in range(n):
	(width, height, x, y) = map(int, input().split())
	s1 = x * height
	s2 = y * width
	s3 = (width - x - 1) * height
	s4 = (height - y - 1) * width
	print(max(s1, s2, s3, s4))


l = int(input(''))
k = []
for i in range(l):
	(a, b, x, y) = map(int, input('').split())
	x += 1
	y += 1
	m = 0
	if a - x >= x:
		m = a - x
	else:
		m = x - 1
	k.append(m * b)
	if b - y >= y:
		m = b - y
	else:
		m = y - 1
	k.append(m * a)
for i in range(0, len(k), 2):
	print(max(k[i], k[i + 1]))


t = int(input(''))
tr = [0] * t
for x in range(0, t):
	nekaj = input('').split()
	a = int(nekaj[0])
	b = int(nekaj[1])
	pa = int(nekaj[2]) + 1
	pb = int(nekaj[3]) + 1
	rezultat = 0
	rezultat = (a - pa) * b
	if rezultat < (b - pb) * a:
		rezultat = (b - pb) * a
	if rezultat < (pb - 1) * a:
		rezultat = (pb - 1) * a
	if rezultat < (pa - 1) * b:
		rezultat = (pa - 1) * b
	tr[x] = rezultat
for y in range(0, t):
	print(tr[y])


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	x1 = a - x - 1
	x2 = x - 1
	y1 = b - y - 1
	y2 = y - 1
	ans1 = max(x1, x2) * b
	ans2 = max(y1, y2) * a
	if x2 >= x1:
		ans1 += b
	if y2 >= y1:
		ans2 += a
	ans = max(ans1, ans2)
	print(ans)


def main():
	from sys import stdin, stdout
	for _ in range(int(stdin.readline())):
		(a, b, x, y) = map(int, stdin.readline().split())
		ans = max([x * b, (a - x - 1) * b, y * a, (b - y - 1) * a])
		stdout.write(str(ans) + '\n')
main()


query = int(input())
for _ in range(query):
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	(s1, s2, s3, s4) = (0, 0, 0, 0)
	s1 = (y - 1) * a
	s2 = (a - x) * b
	s3 = (b - y) * a
	s4 = (x - 1) * b
	print(max(s1, s2, s3, s4))


tests = int(input())
for te in range(tests):
	(cols, rows, x, y) = list(map(int, input().split()))
	if cols != 1:
		ans = max((x - 0) * rows, (cols - 1 - x) * rows)
		ans = max(ans, cols * (y - 0))
		ans = max(ans, cols * (rows - 1 - y))
		print(ans)
	else:
		ans = max(y - 0, rows - 1 - y)
		print(ans)


import sys
input = lambda : sys.stdin.readline().strip()
for i in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	print(max(a * y, b * x, a * (b - y - 1), b * (a - x - 1)))


from operator import itemgetter
from collections import Counter

def solve(a, b, x, y):
	area1 = x * b
	area2 = (a - x - 1) * b
	area3 = a * y
	area4 = a * (b - y - 1)
	print(max(area1, area2, area3, area4))

def main():
	t = int(input())
	for i in range(t):
		(a, b, x, y) = map(int, input().split())
		solve(a, b, x, y)

def __starting_point():
	main()
__starting_point()


t = int(input())
ans_list = []
for i in range(t):
	(a, b, x, y) = [int(s) for s in input().split(' ')]
	ans = max(a * (b - y - 1), a * y, b * x, b * (a - x - 1))
	ans_list.append(ans)
for ans in ans_list:
	print(ans)


from sys import stdin

def main():
	t = int(stdin.readline().strip())
	for i in range(t):
		(a, b, x, y) = [int(y) for y in stdin.readline().strip().split()]
		print(max(x * b, (a - 1 - x) * b, a * y, a * (b - 1 - y)))
main()


n = int(input())
for _ in range(n):
	(a, b, x, y) = [int(i) for i in input().split()]
	print(max((a - x - 1) * b, x * b, a * (b - y - 1), a * y))


t = int(input())
solutions = []
for i in range(t):
	string = str(input())
	st = string.split()
	a = int(st[0])
	b = int(st[1])
	x = int(st[2])
	y = int(st[3])
	case1 = (b - y - 1) * a
	case2 = y * a
	case3 = x * b
	case4 = (a - x - 1) * b
	case = max(case1, case2, case3, case4)
	solutions.append(case)
for solution in solutions:
	print(solution)


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
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()

def test():
	(a, b, x, y) = map(int, input().split())
	return max(max(x, a - 1 - x) * b, max(y, b - 1 - y) * a)
t = int(input())
for _ in range(t):
	print(test())


t = int(input())
matrix = []

def checkTop(a, y):
	base = 0
	height = 0
	if y != 0:
		height += y
		base += a
	return base * height

def checkRight(a, b, x):
	base = 0
	height = 0
	if x != a:
		base += a - 1 - x
		height += b
	return base * height

def checkBottom(a, b, y):
	base = 0
	height = 0
	if y != b:
		height += b - 1 - y
		base += a
	return base * height

def checkLeft(b, x):
	base = 0
	height = 0
	if x != 0:
		base += x
		height += b
	return base * height
if 1 <= t <= 10 ** 4:
	for i in range(0, t):
		distance = tuple(input().split())
		a = int(distance[0])
		b = int(distance[1])
		x = int(distance[2])
		y = int(distance[3])
		areas = [checkTop(a, y), checkRight(a, b, x), checkBottom(a, b, y), checkLeft(b, x)]
		print(max(areas))


n = int(input())
for i in range(n):
	(a, b, x, y) = map(int, input().split(' '))
	x += 1
	y += 1
	ans_1 = max(a - x, x - 1)
	ans_1 *= b
	ans_2 = max(b - y, y - 1)
	ans_2 *= a
	print(max(ans_1, ans_2))


from functools import reduce
import os
import sys
from collections import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

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

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

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
for _ in range(inn()):
	(a, b, x, y) = value()
	(res1, res2, res3, res4) = (-1, -1, -1, -1)
	(a, b) = (b, a)
	if x - 1 >= 0:
		res1 = x * a
	if x + 1 < b:
		res2 = (b - x - 1) * a
	if y - 1 >= 0:
		res3 = y * b
	if y + 1 < a:
		res4 = (a - y - 1) * b
	print(max(res1, res2, res3, res4))


num_problems = int(input())
for current_problem in range(num_problems):
	areas = []
	numbers = []
	inp = input()
	inp = inp.split(' ')
	for current_number in inp:
		numbers.append(int(current_number))
	width = numbers[0]
	height = numbers[1]
	dead_pixel_x = numbers[2]
	dead_pixel_y = numbers[3]
	areas.append(max(dead_pixel_y * width, (height - dead_pixel_y - 1) * width))
	areas.append(max(dead_pixel_x * height, (width - dead_pixel_x - 1) * height))
	print(max(areas))


from math import *
zzz = int(input())
for zz in range(zzz):
	(a, b, x, y) = list(map(int, input().split()))
	print(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))


t = int(input())
for ti in range(t):
	inp = input().split()
	(a, b, x, y) = (int(inp[0]), int(inp[1]), int(inp[2]), int(inp[3]))
	print(max(b * x, b * (a - x - 1), a * y, a * (b - y - 1)))


t = int(input())
a = 0
b = 0
x = 0
y = 0
for k in range(t):
	(a, b, x, y) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	if x * b == max([x * b, y * a, (a - 1 - x) * b, (b - 1 - y) * a]):
		print(x * b)
	elif y * a == max([x * b, y * a, (a - 1 - x) * b, (b - 1 - y) * a]):
		print(y * a)
	elif (a - 1 - x) * b == max([x * b, y * a, (a - 1 - x) * b, (b - 1 - y) * a]):
		print((a - 1 - x) * b)
	else:
		print((b - 1 - y) * a)


def sol():
	inp = input().split(' ')
	tx = int(inp[0])
	ty = int(inp[1])
	x = int(inp[2])
	y = int(inp[3])
	print(max(tx * y, tx * (ty - y - 1), ty * x, ty * (tx - x - 1)))
for i in range(int(input())):
	sol()


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 solve():
	(a, b, x, y) = num_input()
	print(max((a - x - 1) * b, x * b, a * y, a * (b - y - 1)))
t = int(input())
for _ in range(t):
	solve()


for u in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	if x >= a - x - 1:
		n = x
	else:
		n = a - x - 1
	if y >= b - y - 1:
		m = y
	else:
		m = b - y - 1
	s1 = n * b
	s2 = m * a
	print(max(s1, s2))


for _ in range(int(input())):
	(a, b, x, y) = list(map(int, input().split()))
	x += 1
	y += 1
	v1 = (x - 1) * b
	v2 = (a - x) * b
	v3 = (y - 1) * a
	v4 = (b - y) * a
	print(max(v1, v2, v3, v4))


d = int(input())
n1 = 0
n2 = 0
n3 = 0
n4 = 0
for i in range(d):
	(a, b, c, v) = map(int, input().split())
	n1 = a * v
	n2 = a * (b - v - 1)
	n3 = b * (a - c - 1)
	n4 = b * c
	if n1 > n2:
		s1 = n1
	else:
		s1 = n2
	if n3 > n4:
		s2 = n3
	else:
		s2 = n4
	if s1 > s2:
		print(s1)
	else:
		print(s2)


t = int(input())

def find(a, b, x, y):
	arest = a - (x + 1)
	m = max(x, arest)
	brest = b - (y + 1)
	n = max(y, brest)
	res = max(n * a, m * b)
	return res
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	print(find(a, b, x, y))


T = int(input())
while T > 0:
	(a, b, x, y) = map(int, input().split())
	ans = 0
	tm = y * a
	if tm > ans:
		ans = tm
	tm = x * b
	if tm > ans:
		ans = tm
	tm = (b - y - 1) * a
	if tm > ans:
		ans = tm
	tm = (a - x - 1) * b
	if tm > ans:
		ans = tm
	print(ans)
	T -= 1


n = input('')
final_output = []
for i in range(int(n)):
	the_string = input('')
	(a, b, x, y) = the_string.split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	max_width = a
	max_height = b
	if x > a - x - 1:
		max_width = x
	else:
		max_width = a - x - 1
	if y > b - y - 1:
		max_height = y
	else:
		max_height = b - y - 1
	a1 = b * max_width
	a2 = a * max_height
	output = max(a1, a2)
	final_output.append(output)
for x in final_output:
	print(x)


from typing import List
import collections
import bisect
import itertools
import functools
from fractions import gcd
import heapq
from math import ceil, sqrt, floor
t = int(input())
for _ in range(t):
	(a, b, x, y) = list(map(int, input().split()))
	ret = max(b * x, b * (a - x - 1), a * y, a * (b - y - 1))
	print(ret)


n = int(input())
for i in range(n):
	(a, b, x, y) = [int(i) for i in input().split(' ')]
	if a - x > x:
		w = a - x - 1
	else:
		w = x
	if b - y > y:
		v = b - y - 1
	else:
		v = y
	s = max(w * b, v * a)
	print(s)


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


for i in [0] * int(input()):
	(a, b, x, y) = map(int, input().split())
	u = x * b
	d = (a - 1 - x) * b
	r = y * a
	l = (b - 1 - y) * a
	print(max(u, d, r, l))


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


def readData():
	numOfCases = int(input().rstrip('\n'))
	rawLines = [input().rstrip('\n').split(' ') for _ in range(numOfCases)]
	testCases = [(int(a), int(b), int(x) + 1, int(y) + 1) for [a, b, x, y] in rawLines]
	return testCases
testCases = readData()
for (a, b, x, y) in testCases:
	p1 = a * (b - y)
	p2 = (a - x) * b
	p3 = a * (y - 1)
	p4 = (x - 1) * b
	print(max([p1, p2, p3, p4]))


n = int(input())
for r in range(n):
	(a, b, x, y) = map(int, input().split())
	l = [x * b, (a - x - 1) * b, a * y, a * (b - y - 1)]
	print(max(l))


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


def test():
	(a, b, x, y) = [int(i) for i in input().split(' ')]
	rect1 = x * b
	rect2 = y * a
	rect3 = (b - (y + 1)) * a
	rect4 = (a - (x + 1)) * b
	print(max(rect1, rect2, rect3, rect4))
num_tests = int(input())
for i in range(num_tests):
	test()


for t in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	sd = (b - y - 1) * a
	su = y * a
	sl = x * b
	sr = (a - x - 1) * b
	print(max(sd, su, sl, sr))


t = int(input())
for test_case in range(t):
	(a, b, x, y) = [int(x) for x in input().split()]
	res = 0
	left = 0
	right = 0
	up = 0
	down = 0
	if x > 0:
		left = b * x
	if x < a - 1:
		right = b * (a - 1 - x)
	if y > 0:
		up = a * y
	if y < b:
		down = a * (b - 1 - y)
	res = max(left, right, up, down)
	print()
	print(res)
	print()


t = int(input())
for _ in range(t):
	(a, b, x, y) = map(int, input().split())
	area1 = x * b
	area2 = (a - x - 1) * b
	area3 = a * y
	area4 = a * (b - y - 1)
	print(max(area1, area2, area3, area4))


for i in range(int(input())):
	(length, height, x, y) = map(int, input().split())
	print(max(length * y, height * x, length * (height - y - 1), height * (length - x - 1)))


def func(a, b, x, y):
	X1 = x
	X2 = a - x - 1
	Y1 = y
	Y2 = b - y - 1
	A1 = X1 * b
	A2 = Y1 * a
	A3 = b * X2
	A4 = a * Y2
	ans = max(A1, A2, A3, A4)
	print(ans)
t = int(input())
while t != 0:
	t -= 1
	[a, b, x, y] = [int(x) for x in input().split()]
	func(a, b, x, y)


t = input()
t = int(t)
for i in range(0, t):
	the_string = input()
	(a, b, x, y) = the_string.split()
	(a, b, x, y) = (int(a), int(b), int(x), int(y))
	a1 = x * b
	a2 = y * a
	a3 = (b - y - 1) * a
	a4 = (a - x - 1) * b
	print(max(a1, a2, a3, a4))


t = int(input())
for _ in range(t):
	(a, b, x, y) = map(int, input().split())
	x1 = a - x - 1
	y1 = b - y - 1
	ans = max(a * max(y, y1), b * max(x, x1))
	print(ans)


from sys import exit

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

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

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

def getsize(a, b, x, y):
	ans = 0
	ans = max(ans, x * b)
	ans = max(ans, (a - x - 1) * b)
	ans = max(ans, a * y)
	ans = max(ans, a * (b - y - 1))
	return ans
t = ii()
for _ in range(t):
	(a, b, x, y) = iis()
	ans = getsize(a, b, x, y)
	print(ans)


try:
	for _ in range(int(input())):
		(a, b, x, y) = map(int, input().split())
		x = x + 1
		y = y + 1
		m = (x - 1) * b
		n = (a - x) * b
		p = (y - 1) * a
		q = (b - y) * a
		print(max(m, n, p, q))
except:
	pass


t = int(input())
ls = []
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	m = max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a)
	ls.append(m)
for i in ls:
	print(i)


n = int(input())
Result = []
for i in range(0, n):
	h = None
	List = list(map(int, input().strip().split()))[0:4]
	Screen_y = List[0]
	Screen_x = List[1]
	Dead_pixel_y = List[2]
	Dead_pixel_x = List[3]
	left_difference = Dead_pixel_y
	h = left_difference
	right_difference = Screen_y - Dead_pixel_y - 1
	if right_difference > left_difference:
		h = right_difference
	up_difference = Dead_pixel_x
	h_ = up_difference
	down_difference = Screen_x - Dead_pixel_x - 1
	if down_difference > up_difference:
		h_ = down_difference
	h1 = h * Screen_x
	High = h1
	h2 = h_ * Screen_y
	if h2 > h1:
		High = h2
	Result.append(High)
for i in Result:
	print(i)


t = int(input())
for i in range(t):
	(a, b, x, y) = input().split(' ')
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	x += 1
	y += 1
	aa = a * (y - 1)
	bb = a * abs(b - y)
	cc = b * (x - 1)
	dd = b * abs(a - x)
	ans = max(aa, bb)
	ans = max(ans, cc)
	ans = max(ans, dd)
	print(ans)


s = []
t = int(input())
for jjjh in range(0, t):
	x = input()
	xx = x.split()
	a = int(xx[0])
	b = int(xx[1])
	x = int(xx[2]) + 1
	y = int(xx[3]) + 1
	r = []
	if a == 1 and b != 1:
		r.append(y - 1)
		r.append(b - y)
		s.append(max(r))
	elif b == 1 and a != 1:
		r.append(x - 1)
		r.append(a - x)
		s.append(max(r))
	else:
		if x > a / 2:
			f = x - 1
		else:
			f = a - x
		if y > b / 2:
			z = y - 1
		else:
			z = b - y
		r.append(f * b)
		r.append(z * a)
		s.append(max(r))
for i in s:
	print(i)


def get_res():
	(a, b, x, y) = [int(x) for x in input().split(' ')]
	return max([(a - x - 1) * b, (b - y - 1) * a, x * b, y * a])
i = int(input())
for j in range(i):
	print(get_res())


t = int(input())
while t:
	(a, b, x, y) = map(int, input().split())
	left = x * b
	right = (a - 1 - x) * b
	up = a * y
	down = (b - 1 - y) * a
	print(max(max(left, right), max(up, down)))
	t -= 1


testcases = int(input())
for j in range(testcases):
	values = list(map(int, input().split()))
	a = values[0]
	b = values[1]
	x = values[2]
	y = values[3]
	area1 = 0
	area2 = 0
	if x < a - x:
		area1 = (a - x - 1) * b
	elif x >= a - x:
		area1 = x * b
	if y < b - y:
		area2 = (b - y - 1) * a
	elif y >= b - y:
		area2 = y * a
	print(max(area1, area2))


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	t1 = max(x, a - 1 - x)
	t2 = max(y, b - 1 - y)
	t3 = t1 * b
	t4 = t2 * a
	t5 = max(t3, t4)
	print(t5)


t = int(input())
r = ''
for i in range(t):
	(a, b, x, y) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	s1 = x * b
	s2 = y * a
	s3 = (a - x - 1) * b
	s4 = (b - y - 1) * a
	s = max(s1, s2, s3, s4)
	r += str(s) + '\n'
print(r)


t = int(input())
test_cases = [input() for i in range(t)]

def solve(test_case):
	(x, y, a, b) = map(int, test_case.split())
	print(max(x * max(b, y - b - 1), y * max(a, x - a - 1)))
for test_case in test_cases:
	solve(test_case)


testCases = int(input())
for t in range(testCases):
	(a, b, x, y) = map(int, input().rstrip().split())
	areaCal = dict()
	areaCal.update(leftArea=b * x)
	areaCal.update(rightArea=b * (a - (x + 1)))
	areaCal.update(upArea=a * y)
	areaCal.update(downArea=a * (b - (y + 1)))
	max_area = 0
	for value in areaCal.values():
		if value > max_area:
			max_area = value
	print(max_area)


_ = int(input())
for __ in range(_):
	(a, b, x, y) = list(map(int, input().split()))
	res = 0
	res = max(res, (a - x - 1) * b)
	res = max(res, a * (b - y - 1))
	res = max(res, x * b)
	res = max(res, a * y)
	print(res)


n = int(input())
l = []
for i in range(n):
	(x, y, x1, y1) = map(int, input().split())
	a = x1 * y
	b = x * y1
	c = x * (y - y1 - 1)
	d = (x - x1 - 1) * y
	l.append(max(a, b, c, d))
for i in l:
	print(i)


from math import *
for asd in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	c1 = x * b
	c2 = a * y
	c3 = b * (a - x - 1)
	c4 = a * (b - y - 1)
	print(max(c1, c2, c3, c4))


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	bottom = a * (b - y - 1)
	top = a * y
	right = b * (a - x - 1)
	left = b * x
	print(max(top, bottom, left, right))


import math
q = int(input())
for _ in range(q):
	(a, b, x, y) = map(int, input().split())
	ans = max(a * y, b * x)
	ans = max(ans, (b - y - 1) * a)
	ans = max(ans, (a - x - 1) * b)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	(res1, res2, res3, res4) = (-1, -1, -1, -1)
	if x - 1 >= 0:
		res1 = x * b
	if x + 1 < a:
		res2 = (a - x - 1) * b
	if y - 1 >= 0:
		res3 = y * a
	if y + 1 < b:
		res4 = (b - y - 1) * a
	print(max(res1, res2, res3, res4))


t = int(input())
for i in range(0, t):
	(a, b, x, y) = map(int, input().split())
	a1 = 0
	a2 = 0
	a3 = 0
	a4 = 0
	if x - 1 >= 0:
		a1 = x * b
	if x + 1 < a:
		a2 = (a - x - 1) * b
	if y - 1 >= 0:
		a3 = y * a
	if y + 1 < b:
		a4 = (b - y - 1) * a
	s = max(a1, a2, a3, a4)
	print(s)


for i in range(int(input())):
	x = [int(x) for x in input().split()]
	print(max(max(x[2], x[0] - 1 - x[2]) * x[1], max(x[3], x[1] - 1 - x[3]) * x[0]))


import sys, atexit, io
from collections import defaultdict, Counter
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def main():
	for _ in range(int(input())):
		(a, b, x, y) = [int(s) for s in input().split()]
		print(max([x * b, y * a, (a - x - 1) * b, a * (b - y - 1)]))
main()


def max_area(a, b, x, y):
	area_1 = 0
	area_2 = 0
	area_3 = 0
	area_4 = 0
	if x < a - x:
		a1 = a - x - 1
		b1 = b
		area_1 = a1 * b1
	else:
		a2 = x
		b2 = b
		area_2 = a2 * b2
	if y < b - y:
		a3 = a
		b3 = b - y - 1
		area_3 = a3 * b3
	else:
		a4 = a
		b4 = y
		area_4 = a4 * b4
	return max(area_1, area_2, area_3, area_4)
n = int(input())
data = []
for i in range(n):
	data.append(list(map(int, input().split())))
for pack in data:
	(a, b, x, y) = pack
	print(max_area(a, b, x, y))


t = int(input())
abxy = []
for _ in range(t):
	abxy.append(tuple((int(x) for x in input().split())))
for ab in abxy:
	ded = (ab[2], ab[3])
	res = (ab[0], ab[1])
	x = (res[0] - ded[0], ded[0])
	y = (res[1] - ded[1], ded[1])
	print(max(x[0] * (y[0] - 1), (x[0] - 1) * y[0], x[1] * (y[1] - 1), (x[1] - 1) * y[1], (x[0] - 1) * res[1], res[0] * (y[1] - 1), (x[1] - 1) * res[1], res[0] * (y[0] - 1), res[0] * y[1], res[1] * x[1]))


for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	e = a - c - 1
	f = b - d - 1
	l = [c * b, d * a, e * b, f * a]
	l.sort()
	if c == 0 and d == 0 and (b - 1 == 0):
		print((a - 1) * b)
		continue
	if c == 0 and d == 0 and (a - 1 == 0):
		print((b - 1) * a)
		continue
	print(l[3])


for i in range(int(input())):
	q = []
	(a, b, x, y) = [int(z) for z in input().split()]
	if b - y - 1 > 0:
		q.append((b - y - 1) * a)
	if y > 0:
		q.append(y * a)
	if a - x - 1 > 0:
		q.append((a - x - 1) * b)
	if x > 0:
		q.append(x * b)
	print(max(q))


for _ in range(int(input())):
	(a, b, x, y) = [int(__) for __ in input().split()]
	print(max([x * b, (a - 1 - x) * b, a * y, a * (b - 1 - y)]))


t_cases = int(input().strip())
count = 0
while count < t_cases:
	temp = list(map(int, input().strip().split(' ')))
	max_x = temp[0]
	max_y = temp[1]
	dead_x = temp[2]
	dead_y = temp[3]
	x_limit = max(abs(dead_x), abs(max_x - dead_x - 1))
	y_limit = max(abs(dead_y), abs(max_y - dead_y - 1))
	max_area = max(max_x * y_limit, x_limit * max_y)
	print(max_area)
	count += 1


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	q = a * (b - y - 1)
	w = a * y
	e = (a - x - 1) * b
	r = b * x
	print(max(q, w, e, r))


from __future__ import division, print_function
import os, sys
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(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

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

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

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

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	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) % MOD

def comb(n, x):
	(a, b) = (1, 1)
	for i in range(1, x + 1):
		a *= n + 1 - i
		b *= i
	return a // b % MOD

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 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 and n > 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):
	if y == 0:
		return 1
	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)]
	(prime[0], prime[1]) = (False, False)
	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

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

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

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.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
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
small = 'abcdefghijklmnopqrstuvwxyz'
large = small.upper()
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def interact(x, y):
	print('?', x + 1, y + 1)
	space = input()
	sys.stdout.flush()
	return int(input())

def solve():
	(a, b, x, y) = read()
	case1 = x * b
	case2 = a * y
	case3 = (a - x - 1) * b
	case4 = a * (b - y - 1)
	print(max(max(case1, case2), max(case3, case4)))
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')
t = scanner()
for i in range(t):
	solve()


t = int(input())
for _ in range(t):
	(a, b, x, y) = (int(i) for i in input().split())
	res = max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a)
	print(res)


no = int(input())
res = []
for i in range(no):
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	left = (x - 1) * b
	right = (a - x) * b
	above = a * (y - 1)
	below = (b - y) * a
	mm = max(left, right, above, below)
	res.append(mm)
for i in res:
	print(i)


import math
testCases = int(input())
for _ in range(testCases):
	(a, b, x, y) = map(int, input().split())
	areas = []
	areas.append((b - (y + 1)) * a)
	areas.append(b * (a - (x + 1)))
	areas.append(a * y)
	areas.append(b * x)
	print(max(areas))


def revolt(a, b, x, y):
	x = x + 1
	y = y + 1
	val = max(b * (x - 1), b * (a - x), a * (y - 1), a * (b - y))
	val1 = val ** 0.5
	if isinstance(val1, int):
		return val1 * (val1 - 1)
	return val
for _ in range(int(input())):
	(a, b, x, y) = list(map(int, input().split()))
	print(revolt(a, b, x, y))


k = int(input())
for i in range(k):
	(a, b, c, d) = map(int, input().split())
	max1 = 0
	max2 = 0
	nd1 = min(c - 0, a - c)
	nd2 = min(d - 0, b - d)
	if nd1 == a - c:
		gun1 = a - nd1
		max1 = gun1 * b
	else:
		gun1 = a - (c + 1)
		max1 = gun1 * b
	if nd2 == b - d:
		gun2 = b - nd2
		max2 = gun2 * a
	else:
		gun2 = b - (d + 1)
		max2 = gun2 * a
	maxi = max(max1, max2)
	print(maxi)


l = []
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	(c1, d1) = (c + 1, d + 1)
	l.append(max((a - c1) * b, (b - d1) * a, c * b, d * a))
for i in l:
	print(i)


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	p = max(x, a - x - 1)
	q = max(y, b - y - 1)
	print(max(p * b, q * a))


n = int(input())
for i in range(n):
	l = [int(k) for k in input().split()]
	xl = l[0]
	yl = l[1]
	xd = l[2] + 1
	yd = l[3] + 1
	ans = max((xl - xd) * yl, xl * (yl - yd), (xd - 1) * yl, xl * (yd - 1))
	print(ans)


for run in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	left = x * b
	right = (a - 1 - x) * b
	top = a * y
	down = a * (b - 1 - y)
	print(max(left, right, top, down))


t = int(input())
while t > 0:
	(a, b, x, y) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	m = y * a
	if m < (b - y - 1) * a:
		m = (b - y - 1) * a
	if m < x * b:
		m = x * b
	if m < (a - x - 1) * b:
		m = (a - x - 1) * b
	print(m)
	t -= 1


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


from math import *

def binarySearch(arr, x, i):
	l = i
	r = len(arr) - 1
	while l <= r:
		mid = (l + r) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def js(arr, x):
	l = 0
	r = len(arr) - 1
	ans = -1
	while l <= r:
		m = (l + r) // 2
		if arr[m] <= x:
			ans = m
			l = m + 1
		else:
			r = m - 1
	return ans

def jg(arr, x):
	l = 0
	r = len(arr) - 1
	ans = -1
	while l <= r:
		m = (l + r) // 2
		if arr[m] >= x:
			ans = m
			r = m - 1
		else:
			l = m + 1
	return ans

def ceil(a, b):
	if a % b == 0:
		return int(a / b)
	else:
		return a // b + 1
for i in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	ans = 0
	ans = max(ans, a * (b - y - 1))
	ans = max(ans, b * (a - x - 1))
	ans = max(ans, a * y)
	ans = max(ans, x * b)
	print(ans)


T = int(input())
for ti in range(T):
	(a, b, x, y) = map(int, input().split())
	sol = max([x * b, (a - (x + 1)) * b, y * a, (b - (y + 1)) * a])
	print(sol)


for ttt in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	p = b * (x - 1)
	q = b * (a - x)
	r = a * (y - 1)
	s = a * (b - y)
	print(max(p, q, r, s))


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	(left, right, up, down) = (0, 0, 0, 0)
	a += 1
	b += 1
	if a - 1 > -1:
		left = a - 1
	if a + 1 <= x:
		right = x - a
	if b - 1 > -1:
		up = b - 1
	if b + 1 <= y:
		down = y - b
	left *= y
	right *= y
	up *= x
	down *= x
	print(max(left, right, up, down))


t = int(input())
new_l = list()
for i in range(t):
	string = list(input().split(' '))
	s1 = (int(string[0]) - int(string[2]) - 1) * int(string[1])
	s2 = (int(string[0]) - (int(string[0]) - int(string[2]) - 1) - 1) * int(string[1])
	s3 = int(string[0]) * (int(string[1]) - int(string[3]) - 1)
	s4 = int(string[0]) * (int(string[1]) - (int(string[1]) - int(string[3]) - 1) - 1)
	new_l.append(max(s1, s2, s3, s4))
for i in new_l:
	print(i)


t = int(input())
res = []
for i in range(t):
	(a, b, x, y) = map(int, input().split(' '))
	s1 = x * b
	s2 = (a - x - 1) * b
	s3 = y * a
	s4 = (b - y - 1) * a
	res.append(max(s1, s2, s3, s4))
for i in range(len(res)):
	print(res[i])


import sys

def main():
	n = int(input())
	for _ in range(n):
		(a, b, x, y) = map(int, input().split())
		xp = max(a - x - 1, x)
		yp = max(b - y - 1, y)
		print(max(xp * b, yp * a))
main()


from math import ceil
n = int(input())
for i in range(n):
	(a, b, x, y) = map(int, input().split())
	print(max(b * max(x, a - x - 1), a * max(y, b - y - 1)))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	line = sys.stdin.readline().split()
	(a, b) = (int(line[0]), int(line[1]))
	(x, y) = (int(line[2]), int(line[3]))
	opt1 = max(x, a - x - 1) * b
	opt2 = a * max(y, b - y - 1)
	print(max(opt1, opt2))


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


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


N = int(input())
for _ in range(N):
	(a, b, x, y) = [int(i) for i in input().split()]
	rect1 = (a - x - 1) * b
	rect2 = x * b
	rect3 = (b - y - 1) * a
	rect4 = y * a
	print(max(rect1, rect2, rect3, rect4))


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


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
MOD = 10 ** 9 + 7
t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	ans = [b * max(x, a - x - 1), a * max(y, b - y - 1)]
	print(max(ans))


t = int(input())
for case in range(t):
	(a, b, x, y) = [int(s) for s in input().split(' ')]
	print(max(x * b, y * a, (a - 1 - x) * b, (b - 1 - y) * a))


for _ in range(int(input())):
	l = list(map(int, input().split()))
	x = max(abs(l[1] - l[3] - 1), l[3])
	ans1 = x * l[0]
	y = max(abs(l[0] - l[2] - 1), l[2])
	ans2 = y * l[1]
	print(max(ans1, ans2))


def solution(a, b, x, y):
	l = x * b
	r = (a - 1 - x) * b
	d = y * a
	u = (b - 1 - y) * a
	print(max(l, r, d, u))
t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	solution(a, b, x, y)


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


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	length = max(l[0] - l[2] - 1, l[2])
	breadth = max(l[1] - l[3] - 1, l[3])
	print(max(length * l[1], breadth * l[0]))


def tv(l):
	(a, b, x, y) = (l[0], l[1], l[2], l[3])
	print(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))
for t in range(int(input())):
	l = list(map(int, input().split()))
	tv(l)


a = int(input())
l = []
for i in range(a):
	buf = list(map(int, input().split()))
	l.append(buf)
for i in range(a):
	x = l[i][0] - l[i][2] - 1
	y = l[i][1] - l[i][3] - 1
	x1 = l[i][0] - x - 1
	y1 = l[i][1] - y - 1
	if y >= y1:
		a = y
	else:
		a = y1
	if x >= x1:
		b = x
	else:
		b = x1
	if a * l[i][0] > b * l[i][1]:
		print(l[i][0] * a)
	else:
		print(l[i][1] * b)


cases = int(input())
while cases:
	cases -= 1
	(a, b, x, y) = map(int, input().split())
	x = min(x, a - x - 1)
	y = min(y, b - y - 1)
	print(max((b - y - 1) * a, (a - x - 1) * b))


N = int(input())
for _ in range(N):
	(a, b, x, y) = map(int, input().split())
	if 2 * x < a:
		new_a = a - x - 1
	else:
		new_a = x
	if 2 * y < b:
		new_b = b - y - 1
	else:
		new_b = y
	print(max(new_a * b, a * new_b))


def main():
	t = int(input())
	for __ in range(t):
		(a, b, x, y) = map(int, input().split())
		print(max(max(x * b, (a - 1 - x) * b), max(y * a, (b - 1 - y) * a)))
main()


for t in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	l = [(a - x - 1) * b, (x - 0) * b, (b - y - 1) * a, (y - 0) * a]
	print(max(l))


from math import *
from collections import *
t = int(input())
for y in range(t):
	(a, b, x, y) = map(int, input().split())
	l = max(x, a - x - 1)
	w = max(y, b - y - 1)
	print(max(l * b, a * w))


t = int(input().strip())
for i in range(0, t):
	(a, b, x, y) = map(int, input().strip().split())
	area = max(b * x, a * y, (a - x - 1) * b, (b - y - 1) * a)
	print(area)


from sys import stdin
r = stdin.readline

def main():
	cases = int(r())
	for case in range(cases):
		(a, b, i, j) = map(int, r().strip().split())
		print(max((b - j - 1) * a, j * a, b * i, (a - i - 1) * b))
main()


te = int(input())
while te > 0:
	te -= 1
	(A, B, x, y) = list(map(int, input().split()))
	ans = max(A * y, max(x * B, max((A - 1 - x) * B, A * (B - 1 - y))))
	print(ans)


T = int(input())
ins = []
outs = []
for i in range(T):
	(a, b, x, y) = [int(x) for x in input().split(' ')]
	p = a * y
	q = a * (b - y - 1)
	r = b * x
	s = b * (a - x - 1)
	outs.append(max([p, q, r, s]))
for i in outs:
	print(i)


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


n = int(input())
for _ in range(n):
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	w1 = (x - 1) * b
	w2 = (a - x) * b
	w3 = (y - 1) * a
	w4 = (b - y) * a
	print(max(w1, w2, w3, w4))


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	e = b * x
	f = a * y
	g = a * (b - y - 1)
	h = b * (a - x - 1)
	print(max(e, f, g, h))


def dead_pixel(a, b, x, y):
	l1 = [x, a - (x + 1)]
	l2 = [y, b - (y + 1)]
	if 0 in l1:
		l1.remove(0)
	if 0 in l2:
		l2.remove(0)
	l3 = [a * max(l2), b * max(l1)]
	ar = max(l3)
	return ar
t = int(input())
for _ in range(t):
	abxy = input().split()
	a = int(abxy[0])
	b = int(abxy[1])
	x = int(abxy[2])
	y = int(abxy[3])
	print(dead_pixel(a, b, x, y))


def res(a, b, x, y):
	return max((a - 1 - x) * b, x * b, a * y, (b - 1 - y) * a)
t = int(input())
for i in range(t):
	(a, b, x, y) = [int(x) for x in input().split()]
	print(res(a, b, x, y))


t = int(input())
while t:
	t -= 1
	(a, b, x, y) = map(int, input().split())
	s = 0
	f = abs(a - x - 1) * b
	f1 = abs(x) * b
	f2 = abs(b - y - 1) * a
	f3 = abs(y) * a
	print(max(f, f1, f2, f3))


t = int(input())
for i in range(t):
	ti = list(map(int, input().split()))
	out1 = (ti[0] - ti[2] - 1) * ti[1]
	out2 = (ti[1] - ti[3] - 1) * ti[0]
	out3 = ti[0] * ti[3]
	out4 = ti[1] * ti[2]
	print(max(out1, out2, out3, out4))


import math
import sys
import itertools
import fractions
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
for t in wtf[1:]:
	(a, b, x, y) = map(int, t.split())
	ans = []
	if x - 1 >= 0:
		ans.append(x * b)
	if x + 1 < a:
		ans.append((a - x - 1) * b)
	if y - 1 >= 0:
		ans.append(y * a)
	if y + 1 < b:
		ans.append((b - y - 1) * a)
	print(max(ans))


import math
import sys
Input = sys.stdin.readline
metalica = int(input())
for i in range(metalica):
	(a, b, c, d) = map(int, input().split())
	c += 1
	d += 1
	one_text = (a - c) * b
	two_test = (c - 1) * b
	three_test = (b - d) * a
	four_test = (d - 1) * a
	print(max(one_text, two_test, three_test, four_test))


for i in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	n1 = x * b
	n2 = y * a
	n3 = (a - x - 1) * b
	n4 = (b - y - 1) * a
	print(max(n1, n2, n3, n4))


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


t = int(input())
for n in range(1, t + 1):
	list = []
for n in range(1, t + 1):
	(a, b, x, y) = input().split()
	x = int(x)
	y = int(y)
	a = int(a)
	b = int(b)
	list.append(max(x * b, (a - x - 1) * b, a * y, a * (b - y - 1)))
for n in list:
	print(n)


def main():
	for _ in range(int(input())):
		(c, r, xc, yr) = map(int, input().split(' '))
		l = list()
		l.append(c * (r - (yr + 1)))
		l.append(c * yr)
		l.append(xc * r)
		l.append((c - (xc + 1)) * r)
		print(max(l))
main()


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split(' '))
	z = max(abs(0 - y), abs(b - y - 1))
	zz = max(abs(0 - x), abs(a - x - 1))
	print(max(z * a, zz * b))


def solve():
	(a, b, x, y) = map(int, input().split())
	bola = max(x, a - x - 1)
	bolsa = bola * b
	bolb = max(y, b - y - 1)
	bolsb = bolb * a
	bols = max(bolsa, bolsb)
	print(bols)
t = int(input())
for i in range(t):
	solve()


def main():
	for t in range(int(input())):
		(a, b, x, y) = [int(j) for j in input().split()]
		area = max((a - x - 1) * b, (b - y - 1) * a, 0, x * b, y * a)
		print(area)
main()


cases = int(input())
result = []
for i in range(cases):
	(c, r, x, y) = map(int, input().split())
	result.append(max(x * r, (c - x - 1) * r, y * c, (r - y - 1) * c))
for i in result:
	print(i)


import sys
n = int(input())
R = lambda : map(int, input().split())
for i in range(n):
	(a, b, x, y) = R()
	print(max(max(x, a - x - 1) * b, max(y, b - y - 1) * a))


t = int(input())
for i in range(t):
	(a, b, x, y) = (int(x) for x in input().split(' '))
	x += 1
	y += 1
	(up, right) = (0, 0)
	right_x = a - x
	right_y = b
	up_y = b - y
	up_x = a
	s_right = right_x * right_y
	s_up = up_x * up_y
	s_left = a * b - s_right - b
	s_down = a * b - s_up - a
	print(max(s_down, s_left, s_right, s_up))


t = int(input())
for a in range(0, t):
	n = input()
	ar = n.split(' ')
	row = int(ar[0])
	col = int(ar[1])
	dr = int(ar[2]) + 1
	dc = int(ar[3]) + 1
	high1 = max(row * (dc - 1), row * (col - dc))
	high2 = max(col * (dr - 1), col * (row - dr))
	ans = max(high1, high2)
	print(ans)


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

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
for _ in range(I()):
	(a, b, x, y) = R()
	print(max(max(y * a, (b - 1 - y) * a), max(x * b, (a - 1 - x) * b)))


from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from heapq import heappush, heappop
import math
import io
import os
import math
import bisect

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

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

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

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

def digits(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

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

def mapin():
	return map(int, input().split())
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	(a, b, x, y) = mapin()
	print(max(b * max(x, a - x - 1), a * max(y, b - y - 1)))


import sys

def solve(A, B, X, Y):
	return max(X * B, (A - X - 1) * B, A * Y, A * (B - Y - 1))
input = sys.stdin.readline
T = int(input())
for t in range(T):
	(A, B, X, Y) = map(int, input().split())
	ans = solve(A, B, X, Y)
	print(ans)


def get_max_rectangle_area(a, b, x, y):
	return max((a - x - 1) * b, x * b, (b - y - 1) * a, y * a)

def get_input():
	return [int(x) for x in input().split()]

def main():
	test_cases = int(input())
	for i in range(test_cases):
		test_case = get_input()
		print(get_max_rectangle_area(test_case[0], test_case[1], test_case[2], test_case[3]))
main()


x = int(input())
for i in range(x):
	y = str(input()).split(' ')
	z = [int(y[0]), int(y[1]), int(y[2]), int(y[3])]
	areaXinteiro = z[1] * max(z[0] - z[2] - 1, z[2])
	areaYinteiro = z[0] * max(z[1] - z[3] - 1, z[3])
	areaDeadpixelperdida = max(z[0] * z[3], z[1] * z[2])
	area = max(areaXinteiro, areaYinteiro, areaDeadpixelperdida)
	print(area)


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from bisect import *
from math import sqrt, pi, ceil
import math
from itertools import permutations
from copy import deepcopy

def main():
	for t in range(int(input())):
		(a, b, x, y) = map(int, input().split())
		print(max((a - x - 1) * b, (b - y - 1) * a, x * b, y * a))
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()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput

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

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

def li():
	return list(map(int, 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=2):
	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()):
	(a, b, x, y) = mi()
	print(max(a * max(y, b - y - 1), b * max(x, a - x - 1)))


t = int(input())
for i in range(t):
	(a, b, x, y) = [int(g) for g in input().split()]
	print(max(y * a, x * b, (b - y - 1) * a, (a - x - 1) * b))


n = int(input())
for i in range(n):
	(a, b, x, y) = map(int, input().split())
	area1 = max(a - (x + 1), x) * b
	area2 = a * max(b - (y + 1), y)
	print(max(area1, area2))


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	m = max([(x, b), (a - x - 1, b), (a, y), (a, b - y - 1)], key=lambda d: d[0] * d[1])
	print(m[0] * m[1])


for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	f = (b - d - 1) * a
	g = d * a
	h = (a - c - 1) * b
	i = c * b
	print(max(f, g, h, i))


for _ in range(int(input())):
	(a, b, x, y) = [int(h) for h in input().strip().split(' ')]
	l1 = a * (b - y - 1)
	l2 = a * y
	l3 = b * (a - x - 1)
	l4 = b * x
	ans = max(max(l1, l2), max(l3, l4))
	print(ans)


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

def iin():
	return int(input())

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

def main():
	T = iin()
	while T:
		T -= 1
		(a, b, x, y) = lin()
		ans = max(b * x, a * y, b * (a - x - 1), a * (b - y - 1))
		print(ans)
main()


t = int(input())
for i in range(t):
	(m, n, x, y) = map(int, input().strip().split(' '))
	a = max(x, m - (x + 1))
	b = max(y, n - (y + 1))
	if m == 1 or n == 1:
		print(max(a, b))
	else:
		c1 = b * m
		c2 = a * n
		print(max(c1, c2))


for _ in range(int(input())):
	l = input().split(' ')
	for i in range(0, 4):
		l[i] = int(l[i])
	x = (l[0] - 1 - l[2]) * l[1]
	y = (l[1] - 1 - l[3]) * l[0]
	z = l[3] * l[0]
	a = l[2] * l[1]
	print(max(a, x, y, z))


from sys import stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
(t,) = rl()
for _ in range(t):
	(a, b, x, y) = rl()
	print(max(x * b, y * a, (a - x - 1) * b, (b - y - 1) * a))


import sys
from collections import Counter

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 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(a, b, x, y) = MAP()
	mx = max((a - x - 1) * b, x * b, a * (b - y - 1), a * y)
	print(mx)


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


local = False
if local:
	file = open('A.txt', 'r')

def readInput():
	if local:
		return file.readline()
	else:
		return input()

def solve(a, b, x, y):
	x += 1
	y += 1
	return max(b * (a - x), b * (x - 1), a * (b - y), a * (y - 1))
t = int(readInput())
for i in range(t):
	abxy = readInput().split()
	(a, b, x, y) = (int(abxy[0]), int(abxy[1]), int(abxy[2]), int(abxy[3]))
	print(solve(a, b, x, y))


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


t = int(input())
for i in range(t):
	pix = [int(c) for c in input().split()]
	print(max((pix[0] - pix[2] - 1) * pix[1], (pix[1] - pix[3] - 1) * pix[0], pix[0] * pix[3], pix[1] * pix[2]))


for t in range(int(input())):
	(a, b, x, y) = [int(elem) for elem in input().split(' ')]
	print(max(y * a, (b - y - 1) * a, b * (a - x - 1), b * x))


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	k = b * x
	h = a * y
	n = (a - x - 1) * b
	m = (b - y - 1) * a
	print(max(k, h, n, m))


import sys
pin = sys.stdin.readline
pout = sys.stdout.write
ran = range
m = int(pin())
mape = map
for i in ran(m):
	(a, b, x, y) = mape(int, pin().split())
	print(max(y * a, (b - (y + 1)) * a, x * b, (a - (x + 1)) * b))


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


from __future__ import division, print_function
import os, sys
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().split())

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

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

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import math
mod = 10 ** 9
mod += 7

def main():
	for i in range(ii()):
		(a, b, x, y) = mi()
		c = max(a - x - 1, x)
		d = max(b - y - 1, y)
		f = d * a
		e = c * b
		print(max(e, f))
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()


num = int(input())

def find_size(num):
	for i in range(num):
		(a, b, x, y) = [int(i) for i in input().split(' ')]
		print(max((a - x - 1) * b, (b - y - 1) * a, x * b, y * a))
find_size(num)


t = int(input())
while t > 0:
	(a, b, x, y) = tuple([int(i) for i in input().split()])
	A1 = a * max(b - y - 1, y)
	A2 = b * max(a - x - 1, x)
	print(max(A1, A2))
	t -= 1


for _ in range(int(input())):
	(a, b, x, y) = [int(x) for x in input().strip().split(' ')]
	A = x * b
	B = (a - x - 1) * b
	C = y * a
	D = (b - y - 1) * a
	print(max([A, B, C, D]))


for i in range(int(input())):
	(l, h, x, y) = map(int, input().split())
	print(max(x * h, (h - y - 1) * l, l * y, (l - x - 1) * h))


t = int(input())
if 1 <= t <= 10 ** 4:
	for i in range(t):
		(a, b, x, y) = input().split()
		a = int(a)
		b = int(b)
		x = int(x)
		y = int(y)
		p = x + 1
		q = y + 1
		r = p * b
		s = q * a
		u = x * b
		v = y * a
		w = a * b
		if p <= a / 2 and q <= b / 2:
			m = w - r
			n = w - s
			if m > n:
				print(m)
			else:
				print(n)
		if p <= a / 2 and q > b / 2:
			z = a * b - r
			if z >= v:
				print(z)
			elif v > z:
				print(v)
		if p > a / 2 and q <= b / 2:
			z = a * b - s
			if z >= u:
				print(z)
			elif z < u:
				print(u)
		if p > a / 2 and q > b / 2:
			if u >= v:
				print(u)
			elif v > u:
				print(v)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
for _ in range(int(f_input())):
	(a, b, piX, piY) = map(int, f_input().split())
	left = max(0, b * piX)
	right = max(0, b * (a - piX - 1))
	up = max(0, a * piY)
	down = max(0, a * (b - piY - 1))
	f_print(str(max(left, right, up, down)) + '\n')


from collections import defaultdict, Counter

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

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

def main():
	t = int(input())
	for num in range(t):
		(a, b, x, y) = map(int, input().split())
		if x >= abs(a - x):
			size1 = abs(a - abs(a - x)) * b
		else:
			size1 = abs(a - (x + 1)) * b
		if y >= abs(b - y):
			size2 = abs(b - abs(b - y)) * a
		else:
			size2 = abs(b - (y + 1)) * a
		print(max(size1, size2))
main()


def solve(a, b, x, y):
	area_l = a * y
	area_u = x * b
	area_r = a * (b - y - 1)
	area_d = b * (a - x - 1)
	return max(area_l, area_u, area_r, area_d)
t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split(' '))
	area = solve(a, b, x, y)
	print(area)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b, x, y) = map(int, input().split())
	(a1, a2) = (x, a - 1 - x)
	(b1, b2) = (y, b - 1 - y)
	ans = max(a1 * b, a2 * b, b1 * a, b2 * a)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	aa = b * x
	bb = b * (a - 1 - x)
	cc = a * y
	dd = a * (b - 1 - y)
	print(max(aa, bb, cc, dd))


n = int(input())
cases = []
for _ in range(n):
	cases.append(list(map(int, input().split())))
results = []
for case in cases:
	(a, b, x, y) = case
	left = x * b
	right = (a - x - 1) * b
	top = a * (b - 1 - y)
	bottom = a * y
	result = max(left, right, top, bottom)
	results.append(result)
for result in results:
	print(result)


num_cases = int(input())
data_dictionary = {}
for case_number in range(1, num_cases + 1):
	line_data = input().split()
	data_dictionary[case_number] = {'a': int(line_data[0]), 'b': int(line_data[1]), 'x': int(line_data[2]), 'y': int(line_data[3])}

def max_window_size(a, b, x, y):
	box_1 = max(a - (x + 1), x) * b
	box_2 = max(b - (y + 1), y) * a
	size = max(box_1, box_2)
	return size
for case in data_dictionary:
	print(max_window_size(data_dictionary[case]['a'], data_dictionary[case]['b'], data_dictionary[case]['x'], data_dictionary[case]['y']))


def max_area(a, b, x, y):
	return max(x * b, y * a, (a - x - 1) * b, (b - y - 1) * a)
T = int(input())
for t in range(T):
	(a, b, x, y) = list(map(int, input().strip().split()))
	print(max_area(a, b, x, y))


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


try:
	t = input()
	t = int(t)
	while t > 0:
		t = t - 1
		s = input()
		l = s.split()
		m = []
		for i in range(0, len(l)):
			l[i] = int(l[i])
		m.append(l[2] * l[1])
		m.append(l[3] * l[0])
		m.append((l[0] - l[2] - 1) * l[1])
		m.append((l[1] - l[3] - 1) * l[0])
		m.sort()
		print(m[3])
except:
	pass


t = int(input())
for i in range(t):
	inn = [int(x) for x in input().split()]
	a = inn[0]
	b = inn[1]
	x = inn[2]
	y = inn[3]
	left = x * b
	right = (a - 1 - x) * b
	above = a * y
	below = a * (b - 1 - y)
	print(max(left, right, above, below))


import sys
input = sys.stdin.readline
Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
for (a, b, x, y) in Query:
	A = [a * (b - y - 1), a * y, x * b, (a - x - 1) * b]
	print(max(A))


from os import path
from sys import stdin, stdout
maxn = 200005
if path.exists('inp.txt'):
	stdin = open('inp.txt', 'r')
q = int(stdin.readline())
for _ in range(q):
	(a, b, x, y) = map(int, stdin.readline().split())
	ans = max(x * b, (a - x - 1) * b)
	ans = max(ans, max(y * a, (b - y - 1) * a))
	print(ans)


import sys
n = int(input())
while n >= 1:
	numbers = input().split()
	a = int(numbers[0])
	b = int(numbers[1])
	x = int(numbers[2])
	y = int(numbers[3])
	x_used = x + 1
	y_used = y + 1
	a_right = a - x_used
	a_left = x_used - 1
	b_upper = y_used - 1
	b_lower = b - y_used
	solutions = []
	solutions.append(a_right * b)
	solutions.append(a_left * b)
	solutions.append(b_upper * a)
	solutions.append(b_lower * a)
	solution = max(solutions)
	print(solution)
	n = n - 1


n = int(input())
for i in range(n):
	(a, b, x, y) = map(int, input().split(' '))
	w = a - x - 1 if x < a / 2 else x
	h = b - y - 1 if y < b / 2 else y
	print(max(w * b, h * a))


t = int(input())
for i in range(t):
	ar = list(map(int, input().rstrip().split()))
	x = ar[2] + 1
	y = ar[3] + 1
	a = ar[0]
	b = ar[1]
	maxarea = (a - x) * b
	area = (y - 1) * a
	if area > maxarea:
		maxarea = area
	area = (x - 1) * b
	if area > maxarea:
		maxarea = area
	area = a * (b - y)
	if area > maxarea:
		maxarea = area
	print(maxarea)


import math
t = int(input())
for g in range(0, t):
	abxy = list(map(int, input().split()))
	a = abxy[0]
	b = abxy[1]
	x = abxy[2]
	y = abxy[3]
	arr = []
	arr.append(a * y)
	arr.append(a * (b - y - 1))
	arr.append(b * x)
	arr.append(b * (a - x - 1))
	print(max(arr))


t = int(input())
for _ in range(t):
	(a, b, x, y) = map(int, input().split())
	r = max([a * y, a * (b - y - 1), b * x, b * (a - x - 1)])
	print(r)


import sys
from collections import defaultdict as dd
from collections import deque
from functools import *
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from itertools import permutations, product

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def inc(d, c):
	d[c] = d[c] + 1 if c in d else 1

def bo(i):
	return ord(i) - ord('A')

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

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def isvalid(i, j):
	return 0 <= i < n and 0 <= j < n

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
while t > 0:
	t -= 1
	(a, b, x, y) = mi()
	maxi = max([x * b, (a - x - 1) * b, y * a, (b - y - 1) * a])
	print(maxi)


n = int(input())
cases = []
for i in range(n):
	cases.append(list(map(int, input().split())))
for i in cases:
	x = i[0]
	y = i[1]
	a = i[2]
	b = i[3]
	one = y * a
	two = y * (x - a - 1)
	three = x * (y - b - 1)
	four = x * b
	foo = [one, two, three, four]
	print(max(foo))


def dead():
	t = int(input())
	for i in range(t):
		(a, b, x, y) = map(int, input().split())
		if t < 1 or t > 10 ** 4 or a < 1 or (a > 10 ** 4) or (b < 1) or (b > 10 ** 4) or (x < 0) or (x >= a) or (y < 0) or (y >= b):
			return
		x += 1
		y += 1
		B = a * (y - 1)
		T = a * (b - y)
		L = (x - 1) * b
		R = (a - x) * b
		print(max(B, T, L, R))
dead()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(h, w, x, y) = map(int, input().split())
	can = [h * y, h * (w - 1 - y), w * x, w * (h - 1 - x)]
	print(max(can))


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


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


n = int(input())
ans = []
for i in range(n):
	(a, b, x, y) = map(int, input().split())
	(x, y) = (x + 1 if x < a / 2 else a - x, y + 1 if y < b / 2 else b - y)
	ans.append(max((b - y) * a, (a - x) * b))
print(*ans, sep='\n')


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


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
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 [int(x) for x in sys.stdin.readline().split()]

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

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

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

def S():
	return input()

def main():
	n = I()
	ans = []
	for _ in range(n):
		(a, b, c, d) = LI()
		x = max(c, a - (c + 1))
		y = max(d, b - (d + 1))
		sm_a = x * b
		sm_b = a * y
		ans.append(max(sm_a, sm_b))
	for x in ans:
		print(x)
main()


import math as m
T = int(input())
for t in range(0, T):
	(a, b, x, y) = map(int, input().split())
	combs = [x * b, (a - x - 1) * b, y * a, (b - y - 1) * a]
	print(f'{max(combs)}')


t = int(input())
vec = []
for i in range(t):
	(a, b, x, y) = [int(j) for j in input().split(' ')]
	vec.append(max(max(a - x - 1, x) * b, max(b - y - 1, y) * a))
for j in vec:
	print(j)


for t in range(int(input())):
	(a, b, x, y) = [int(i) for i in input().split()]
	l = max(x, a - 1 - x)
	h = max(y, b - 1 - y)
	print(max(l * b, h * a))


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


import math
t = int(input())
for tt in range(t):
	(a, b, x, y) = map(int, input().split())
	t1 = b * x
	t2 = (a - x - 1) * b
	t3 = a * y
	t4 = a * (b - y - 1)
	print(max(t1, t2, t3, t4))


test_case = int(input())

def count_up(len_y, dead_y):
	area = len_y * (dead_y - 0)
	return area

def count_down(len_y, dead_y, last_down):
	area = len_y * (last_down - 1 - dead_y)
	return area

def count_right(len_x, dead_x, last_right):
	area = len_x * (last_right - 1 - dead_x)
	return area

def count_left(len_x, dead_x):
	area = len_x * (dead_x - 0)
	return area
while test_case > 0:
	(length, width, dead_pixel_x, dead_pixel_y) = input().split()
	length = int(length)
	width = int(width)
	dead_pixel_x = int(dead_pixel_x)
	dead_pixel_y = int(dead_pixel_y)
	all_up = count_up(length, dead_pixel_y)
	all_down = count_down(length, dead_pixel_y, width)
	all_right = count_right(width, dead_pixel_x, length)
	all_left = count_left(width, dead_pixel_x)
	print(max(all_down, all_left, all_right, all_up))
	test_case -= 1


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


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	top = y * a
	bottom = (b - y - 1) * a
	right = (a - x - 1) * b
	left = x * b
	print(max([top, bottom, left, right]))


for q in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	res = 0
	if y != 0:
		res = max(res, (y - 1 + 1) * a)
	if y + 1 != b:
		res = max(res, (b - y - 1) * a)
	if x != 0:
		res = max(res, (x - 1 + 1) * b)
	if x + 1 != a:
		res = max(res, (a - x - 1) * b)
	print(res)


num = int(input())
for i in range(num):
	coords = [int(i) for i in input().split(' ')]
	print(max(coords[0] * coords[3], coords[1] * coords[2], coords[0] * (coords[1] - coords[3] - 1), coords[1] * (coords[0] - coords[2] - 1)))


t = int(input())
for _ in range(t):
	(a, b, x, y) = map(int, input().split())
	k = a - x - 1
	m = b - y - 1
	k = k * b
	m = m * a
	p = x * b
	q = y * a
	A = max(k, m, p, q)
	print(A)


import sys
sys.setrecursionlimit(10 ** 6)
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():
	t = II()
	for _ in range(t):
		(a, b, x, y) = MI()
		print(max(x * b, (a - x - 1) * b, a * y, a * (b - y - 1)))
main()


n = int(input())
for i in range(n):
	(a, b, x, y) = [int(i) for i in input().split()]
	l = (x - 0) * b
	r = (a - 1 - x) * b
	u = (b - 1 - y) * a
	lo = (y - 0) * a
	g = max(l, r)
	h = max(lo, u)
	print(max(g, h))


num = int(input())
arr = []
for i in range(num):
	arr.append(input())
arr = [[int(i) for i in c.split(' ')] for c in arr]
for i in range(num):
	print(max(arr[i][0] * (arr[i][1] - arr[i][3] - 1), arr[i][1] * (arr[i][0] - arr[i][2] - 1), arr[i][3] * arr[i][0], arr[i][2] * arr[i][1]))


t = int(input())
for i in range(t):
	possibile_area = []
	pack = list(map(int, input().split(' ')))
	possibile_area.append((pack[0] - pack[2] - 1) * pack[1])
	possibile_area.append(pack[2] * pack[1])
	possibile_area.append(pack[0] * (pack[1] - pack[3] - 1))
	possibile_area.append(pack[0] * pack[3])
	print(max(possibile_area))


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	A1 = x * b
	A2 = y * a
	A3 = (a - 1 - x) * b
	A4 = (b - 1 - y) * a
	print(max(A1, A2, A3, A4))


n = int(input())
for i in range(n):
	(x, y, a, b) = map(int, input().split())
	s = []
	s.append(x * b)
	s.append(x * (y - (b + 1)))
	s.append(y * a)
	s.append(y * (x - (a + 1)))
	print(max(s))


from sys import stdin, stdout

def make_window():
	n = int(stdin.readline())
	for lines in range(n):
		screen = map(int, stdin.readline().split())
		screen = list(screen)
		bad_row = screen[3]
		bad_col = screen[2]
		high_rows = 0
		rows = 0
		high_cols = 0
		cols = 0
		for row in range(screen[1]):
			if row == bad_row:
				rows = 0
				continue
			else:
				rows += 1
				high_rows = max(high_rows, rows)
		for col in range(screen[0]):
			if col == bad_col:
				cols = 0
				continue
			else:
				cols += 1
				high_cols = max(high_cols, cols)
		stdout.write('%d\n' % max(high_cols * screen[1], high_rows * screen[0]))
make_window()


import math
t = int(input())
ans = []
for i in range(t):
	(a, b, x, y) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	area = max(b * max(x, a - 1 - x), a * max(y, b - 1 - y))
	ans.append(area)
for i in range(len(ans)):
	print(ans[i])


def calc(a: int, b: int, x: int, y: int):
	ans1: int = x * b
	ans2: int = b * (a - x - 1)
	ans3: int = a * y
	ans4: int = a * (b - y - 1)
	return max(ans1, ans2, ans3, ans4)

def main():
	for i in range(int(input())):
		(a, b, x, y) = map(int, input().split())
		ans: int = calc(a, b, x, y)
		print(ans)
main()


t = int(input())
while t > 0:
	(a, b, x, y) = input().split(' ')
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	area = max((a - 1 - x) * b, x * b, a * y, a * (b - 1 - y))
	print(area)
	t -= 1


def dead_pixel(a, b, x, y):
	top = x * b
	left = y * a
	bottom = (a - x - 1) * b
	right = a * (b - y - 1)
	return max(left, right, top, bottom)
t = int(input())
for i in range(t):
	(a, b, x, y) = list(map(int, input().split()))
	print(dead_pixel(a, b, x, y))


t = int(input())
for _ in range(t):
	(a, b, x, y) = map(int, input().split(' '))
	x = x + 1
	y = y + 1
	t1 = a * (y - 1)
	t2 = a * abs(b - y)
	t3 = b * (x - 1)
	t4 = b * abs(a - x)
	print(max(t1, t2, t3, t4))


t = int(input())
for o in range(t):
	[a, b, x, y] = list(map(int, input().rstrip().split()))
	s1 = a * y
	s2 = b * x
	s3 = a * (b - y - 1)
	s4 = b * (a - x - 1)
	d = max(s1, s2)
	f = max(s3, s4)
	p = max(d, f)
	print(p)


t = int(input())
for i in range(t):
	poss = []
	(a, b, x, y) = map(int, input().split())
	resCol = x * b
	resCol2 = (a - x - 1) * b
	resRow = a * y
	resRow2 = (b - y - 1) * a
	poss.append(resCol)
	poss.append(resCol2)
	poss.append(resRow)
	poss.append(resRow2)
	print(max(poss))


testcases = int(input())
lis = []
for i in range(testcases):
	tup = tuple(map(int, input().split(' ')))
	lis.append(tup)

def maxcalc(tupl):
	dpx = tupl[2]
	dpy = tupl[3]
	scry = tupl[1]
	scrx = tupl[0]
	c1 = dpy * scrx
	c2 = scry * scrx - c1 - scrx
	c3 = dpx * scry
	c4 = scry * scrx - c3 - scry
	return max(c1, c2, c3, c4)
for tuple in lis:
	print(maxcalc(tuple))


m = int(input())
l = []
for i in range(m):
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	t1 = (a - x) * b
	t2 = (x - 1) * b
	t3 = (b - y) * a
	t4 = (y - 1) * a
	l.append(max(t1, t2, t3, t4))
for i in l:
	print(i)


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


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	p1 = max(x, a - x - 1) * b
	p2 = a * max(y, b - y - 1)
	print(max(p1, p2))


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	x += 1
	y += 1
	d1 = a - x
	d2 = x - 1
	f1 = b - y
	f2 = y - 1
	a1 = d1 * b
	a2 = d2 * b
	a3 = f1 * a
	a4 = f2 * a
	print(max(a1, a2, a3, a4))


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

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

def main():

	def solve():
		(a, b, x, y) = map(int, input().split())
		r1 = a * y
		r2 = a * (b - y - 1)
		r3 = b * x
		r4 = b * (a - x - 1)
		print(max(r1, r2, r3, r4))
	q = int(input())
	for _ in range(q):
		solve()
main()


for o in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	a1 = a * max(y, b - y - 1)
	a2 = b * max(x, a - x - 1)
	print(max(a1, a2))


t = int(input())

def main(string):
	split = string.split()
	a = int(split[0])
	b = int(split[1])
	x = int(split[2]) + 1
	y = int(split[3]) + 1
	if a == 1:
		return max(b - y, y - 1)
	elif b == 1:
		return max(a - x, x - 1)
	else:
		max_1 = max(a - x, x - 1)
		max_2 = max(b - y, y - 1)
		return max(max_1 * b, max_2 * a)
results = []
for i in range(t):
	string = input()
	results.append(main(string))
for result in results:
	print(result)


t = int(input())
while t:
	t -= 1
	(a, b, x, y) = map(int, input().split())
	area1 = a * y
	area2 = x * b
	area3 = (a - 1 - x) * b
	area4 = a * (b - 1 - y)
	print(max(area1, area2, area3, area4))


for _ in range(int(input())):
	(a, b, x, y) = list(map(int, input().split()))
	x += 1
	y += 1
	d = (a - x) * b
	r = (x - 1) * b
	e = a * (b - y)
	f = a * (y - 1)
	print(max(d, r, e, f))


t = int(input())
for i in range(t):
	(a, b, x, y) = [int(x) for x in input().split()]
	h_below = b - (y + 1)
	h_above = b - (h_below + 1)
	beside_right = a - (x + 1)
	beside_left = a - (beside_right + 1)
	area_above = h_above * a
	area_below = h_below * a
	area_left = beside_left * b
	area_right = beside_right * b
	print(max(area_above, area_below, area_left, area_right))


def two(a, b, x, y):
	len = abs(a - x) if abs(a - x) >= abs(x) else x - 1
	opt1 = len * b
	len = abs(b - y) if abs(b - y) >= abs(y) else y - 1
	opt2 = len * a
	return opt1 if opt1 > opt2 else opt2
t = int(input())
i = 0
while i < t:
	x = input().split()
	print(two(int(x[0]), int(x[1]), int(x[2]) + 1, int(x[3]) + 1))
	i = i + 1


import sys

def rr():
	return sys.stdin.readline().rstrip()
rp = print

def print(*args, **kwargs):
	rp('DBG:# ', *args, **kwargs, file=sys.stderr)

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))

def rrle():
	return (line.rstrip() for line in sys.stdin.readlines())

def rrtl():
	return [tuple(map(int, l.split())) for l in rrle()]
from collections import defaultdict

def mus(d=lambda : 0):
	return defaultdict(lambda : defaultdict(d))

def dd0(d=lambda : 0):
	return defaultdict(d)

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def fltn(a):
	(i for sub in a for i in sub)

def yn(x):
	return 'YES' if x else 'NO'
from itertools import tee
from itertools import accumulate
from itertools import groupby
from itertools import permutations

def pairwise(iterable):
	(a, b) = tee(iterable)
	next(b, None)
	return zip(a, b)

def grp(x, key=None):
	return ((i, sum((1 for _ in g))) for (i, g) in groupby(x, key=key))
import math

def rnar():
	return (*rrl(), rrl())

def rn():
	return (*rrl(),)

def dpp(a, b=''):
	print('#| {} |#:^ {} ^:'.format(a, b))

def str_join(i, sep=' '):
	return sep.join(map(str, i))
MOD17 = 10 ** 9 + 7

def read():
	return rrl()

def solve(a, b, x, y):
	t1 = max(x, a - x - 1) * b
	t2 = max(y, b - y - 1) * a
	ans = max(t1, t2)
	return ans
test_count = rri()
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	rp(result)


import sys
import bisect

def metod(x):
	if t[x] == 'A':
		w = a
	else:
		w = b
	for i in range(x + 1, len(t) - 1):
		if t[i] != t[i - 1]:
			if t[i] == 'A':
				w += a
			else:
				w += b
	return w

def morzermorzer():
	(a, b, x, y) = map(int, input().split())
	print(max(y * a, (b - y - 1) * a, x * b, (a - x - 1) * b))
for morzer in range(int(input())):
	morzermorzer()


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


import sys
for t in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	kv1 = x * y
	kv2 = y * a
	kv3 = x * b
	kv5 = (a - (x + 1)) * b
	kv4 = (b - (y + 1)) * a
	print(max(kv5, kv1, kv2, kv3, kv4))


t = int(input())
while t:
	(a, b, x, y) = map(int, input().split())
	(x, y) = (x + 1, y + 1)
	result = max(a * (y - 1), a * (b - y), (x - 1) * b, (a - x) * b)
	print(result)
	t -= 1


for t in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	a1 = a - x - 1
	b1 = b - y - 1
	c = x * b
	d = y * a
	e = a1 * b
	f = b1 * a
	ll = max(c, d, e, f)
	print(ll)


result = []

def main():
	n = int(input())
	for i in range(0, n):
		m = list(map(int, input().split()))
		r1 = (m[0] - m[2] - 1) * m[1]
		r2 = (m[1] - m[3] - 1) * m[0]
		r3 = (m[2] - 1 + 1) * m[1]
		r4 = (m[3] - 1 + 1) * m[0]
		result.append(max(r1, r2, r3, r4))
	for i in result:
		print(i)
main()


t = int(input())
while t > 0:
	(a, b, x, y) = [int(x) for x in input().split()]
	p = x if x >= a - 1 - x else a - 1 - x
	q = y if y >= b - 1 - y else b - 1 - y
	a1 = p * b
	a2 = q * a
	if a1 >= a2:
		print(a1)
	else:
		print(a2)
	t -= 1


from pprint import pprint
import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	(a, b, x, y) = map(int, input().split())
	r1 = a * y
	r2 = a * (b - y - 1)
	r3 = b * x
	r4 = b * (a - x - 1)
	res = max(r1, r2, r3, r4)
	print(res)


t = int(input())
for _ in range(0, t):
	(a, b, x, y) = map(int, input().split())
	row = a - 1
	col = b - 1
	if row == 0:
		temp = col - y
		if temp > y:
			print(temp)
		else:
			print(y)
	elif col == 0:
		temp = row - x
		if temp > x:
			print(temp)
		else:
			print(x)
	elif x == y == 0:
		tmp1 = (a - 1) * b
		tmp2 = a * (b - 1)
		if tmp1 > tmp2:
			print(tmp1)
		else:
			print(tmp2)
	else:
		tmp1 = x * b
		tmp2 = (row - x) * b
		tmp3 = a * y
		tmp4 = a * (col - y)
		lst = [tmp1, tmp2, tmp3, tmp4]
		print(max(lst))


def main():
	T = int(input())
	for i in range(T):
		(a, b, x, y) = input().split()
		m = int(x)
		n = int(a) - (int(x) + 1)
		p = int(y)
		q = int(b) - (int(y) + 1)
		Area = max(max(m, n) * int(b), max(p, q) * int(a))
		print(Area)
main()


for i in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	x = x + 1
	y = y + 1
	ar1 = a - x
	ar2 = a - (ar1 + 1)
	bc1 = b - y
	bc2 = b - (bc1 + 1)
	mx = max(ar1 * b, ar2 * b, bc1 * a, bc2 * a)
	print(mx)


t = int(input())
while t != 0:
	(a, b, x, y) = map(int, input().split())
	m = max(y, b - 1 - y)
	n = max(x, a - x - 1)
	o = max(b * n, m)
	p = max(o, n)
	q = max(a * m, p)
	print(q)
	t = t - 1


for _ in range(int(input())):
	(a, b, x, y) = [int(i) for i in input().strip().split()]
	a1 = y * a
	a2 = (b - 1 - y) * a
	a3 = x * b
	a4 = (a - 1 - x) * b
	ans = max(a1, a2, a3, a4)
	print(ans)


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

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

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

def si():
	return input()
t = ii()
while t:
	t -= 1
	(a, b, x, y) = mi()
	ans = 0
	ans = max(ans, a * y)
	ans = max(ans, b * x)
	x += 1
	y += 1
	ans = max(ans, (a - x) * b)
	ans = max(ans, (b - y) * a)
	print(ans)


from sys import stdin, stdout
Pi = lambda x: stdout.write(str(x) + '\n')
S = lambda x: x * (x + 1) // 2
R = lambda : stdin.readline()
Ri = lambda x: map(int, x.split())

def ver(a, b, x, y):
	op1 = max(x, a - x - 1) * b
	op2 = max(y, b - 1 - y) * a
	return max(op1, op2)

def f(n, k):
	r = min(n - k, k)
	ans = 1
	for i in range(1, r + 1):
		ans = ans * (n - i + 1) // i
	return ans

def main():
	for x in stdin:
		n = int(x)
		ans = 0
		for i in range(1, n + 1):
			(a, b, x, y) = Ri(R())
			Pi(ver(a, b, x, y))
main()


for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	x = x + 1
	y = y + 1
	east = (b - (b - y + 1)) * a
	west = (b - y) * a
	north = (a - (a - x + 1)) * b
	south = (a - x) * b
	if east >= west and east >= north and (east >= south):
		print(east)
	elif west >= east and west >= north and (west >= south):
		print(west)
	elif north >= east and north >= west and (north >= south):
		print(north)
	elif south >= east and south >= west and (south >= north):
		print(south)


for n in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	l = x * b
	w = (a - x - 1) * b
	v = a * y
	n = a * (b - y - 1)
	print(max(l, w, v, n))


def solve(a, b, x, y):
	col = max(b - 1 - y, y)
	area_col = col * a
	row = max(a - 1 - x, x)
	area_row = row * b
	return max(area_col, area_row)
n = input()
for x in range(0, int(n)):
	line = input()
	line_arr = line.split(' ')
	(a, b, x, y) = list(map(lambda x: int(x), line_arr))
	print(solve(a, b, x, y))


import sys
import math
import heapq
import collections
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

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

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')

def printspace(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer(' ')

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

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	(a, b, x, y) = inputnums()
	print(max(a * max(y, b - y - 1), b * max(x, a - x - 1)))


T = int(input())
for i in range(T):
	(a, b, x, y) = map(int, input().split())
	x = x + 1
	y = y + 1
	if a == 1:
		w = abs(y - 1)
		q = abs(b - y)
		if w >= q:
			print(w)
		else:
			print(q)
	elif b == 1:
		w = abs(x - 1)
		q = abs(a - x)
		if w >= q:
			print(w)
		else:
			print(q)
	else:
		w = abs(x - 1) * b
		q = abs(a - x) * b
		z = abs(y - 1) * a
		p = abs(b - y) * a
		s = max(w, q, z, p)
		print(s)


for _ in range(int(input())):
	q = []
	for i in input().split():
		q.append(i)
	a = int(q[0])
	b = int(q[1])
	x = int(q[2])
	y = int(q[3])
	q1 = []
	q1.append(x * b)
	q1.append((a - x - 1) * b)
	q1.append(a * y)
	q1.append(a * (b - y - 1))
	q1.sort()
	print(q1[3])


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.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('\n').split(' ')]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n').split(' ')]

def li3():
	return [int(i) for i in input().rstrip('\n')]

def givemax(x, y):
	return max(x * (y + 1), y * (x + 1))
for _ in range(val()):
	(a, b, x, y) = li()
	x += 1
	y += 1
	m1 = max(0, (x - 1) * y, (y - 1) * x)
	m2 = max((a - x) * (y - 1), y * (a - x - 1))
	m3 = max(x * (b - y - 1), (b - y) * (x - 1))
	m4 = max((a - x - 1) * (b - y), (a - x) * (b - y - 1))
	m5 = max((x - 1) * b, (a - x) * b)
	m6 = max((y - 1) * a, (b - y) * a)
	print(max(m1, m2, m3, m4, m5, m6))


from collections import Counter
from collections import defaultdict
import math
t = int(input())
for _ in range(0, t):
	(a, b, c, d) = list(map(int, input().split()))
	m = max(b * c, b * (a - c - 1), a * (b - d - 1), a * d)
	print(m)


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	r = y
	y += 1
	area1 = a * (y - 1)
	area2 = a * (b - y)
	max1 = max(area1, area2)
	y = r
	x += 1
	area1 = b * (x - 1)
	area2 = b * (a - x)
	max2 = max(area1, area2)
	print(max(max1, max2))


def solution():
	for _ in range(int(input())):
		(row, column, x, y) = [int(i) for i in input().split()]
		arr = (x * column, (row - x - 1) * column, y * row, (column - y - 1) * row)
		print(max(arr))
solution()


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


t = int(input())
while t > 0:
	t = t - 1
	(a, b, x, y) = map(int, input().split())
	lst = []
	lst.append(a * y)
	lst.append(b * x)
	x = x + 1
	y = y + 1
	x = a - x
	y = b - y
	lst.append(a * y)
	lst.append(b * x)
	print(max(lst))


for _ in range(int(input())):
	li = list(map(int, input().split()))
	c = (li[0] - li[2]) * (li[1] - li[3] - 1)
	d = (li[0] - li[2] - 1) * (li[1] - li[3])
	kli = []
	kli.append(li[0] * (li[1] - li[3] - 1))
	kli.append(li[0] * li[3])
	kli.append(li[1] * (li[0] - li[2] - 1))
	kli.append(li[1] * li[2])
	print(max(kli))


t = int(input())
while t > 0:
	t -= 1
	(a, b, x, y) = list(map(int, input().split(' ')))
	nb = ()
	if y < b / 2:
		nb = b - y - 1
	else:
		nb = y
	na = ()
	if x < a / 2:
		na = a - x - 1
	else:
		na = x
	if a * nb >= na * b:
		print(a * nb)
	else:
		print(na * b)


for i in range(int(input())):
	params = [int(i) for i in input().split()]
	h = max(params[0] - (params[2] + 1), params[2])
	w = max(params[1] - (params[3] + 1), params[3])
	print(max(h * params[1], w * params[0]))


for n in range(int(input())):
	c = input().split(' ')
	a = int(c[0])
	b = int(c[1])
	x = int(c[2])
	y = int(c[3])
	halfA = a / 2
	halfB = b / 2
	difA = a - x - 1
	difB = b - y - 1
	if difB < halfB:
		difB = y
	if difA < halfA:
		difA = x
	if a * difB > difA * b:
		print(a * difB)
	else:
		print(b * difA)


n = int(input())
for i in range(n):
	(a, b, x, y) = list(map(int, input().split()))
	max1 = max(x * b, (a - 1 - x) * b)
	max2 = max(y * a, (b - 1 - y) * a)
	print(max(max1, max2))


def solution(l1):
	width = l1[0]
	height = l1[1]
	x = l1[2] + 1
	y = l1[3] + 1
	above = width * (height - y)
	below = width * (y - 1)
	left = height * (x - 1)
	right = height * (width - x)
	return max([above, below, left, right])

def answer():
	n = int(input())
	l1 = []
	while n:
		l1 = input().split()
		l1 = [int(x) for x in l1]
		print(solution(l1))
		n -= 1
answer()


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')
testcases = int(input())
for j in range(testcases):
	values = list(map(int, input().split()))
	a = values[0]
	b = values[1]
	x = values[2]
	y = values[3]
	area1 = 0
	area2 = 0
	if x < a - x:
		area1 = (a - x - 1) * b
	elif x >= a - x:
		area1 = x * b
	if y < b - y:
		area2 = (b - y - 1) * a
	elif y >= b - y:
		area2 = y * a
	print(max(area1, area2))


def func(width, height, x, y):
	up = y * width
	down = (height - y - 1) * width
	left = x * height
	right = (width - x - 1) * height
	return max(up, down, left, right)
t = int(input())
for i in range(t):
	(width, height, x, y) = map(int, input().split())
	res = func(width, height, x, y)
	print(res)


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from itertools import accumulate

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

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

def Lstr():
	return list(sys.stdin.readline().strip())

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

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

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

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

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

def btod(n):
	return int(n, 2)

def common(l1, l2):
	return set(l1).intersection(l2)

def solution():
	for _ in range(Int()):
		(a, b, x, y) = Mint()
		m = max(a * y, a * (b - 1 - y))
		n = max(b * x, b * (a - 1 - x))
		print(max(m, n))
solution()


def deadPixel(list):
	bottom = list[0] * (list[1] - (list[3] + 1))
	top = list[0] * list[1] - (bottom + list[0])
	left = list[1] * list[2]
	right = list[0] * list[1] - (left + list[1])
	return max([bottom, top, left, right])
for i in range(int(input())):
	print(deadPixel(list(map(int, input().split()))))


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = int(1500000.0)
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]
spf[0] = spf[1] = -1

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def fib(n, m):
	if n == 0:
		return [0, 1]
	else:
		(a, b) = fib(n // 2)
		c = a % m * (b % m * 2 - a % m) % m
		d = a % m * (a % m) % m + b % m * b % m % m
		if n % 2 == 0:
			return [c, d]
		else:
			return [d, c + d]

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
for _ in range(int(input())):
	(a, b, x, y) = arrIN()
	ans = max(b * x, b * (a - x - 1), a * y, a * (b - y - 1))
	print(ans)


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


t = int(input())
i = int(0)
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	mx1 = max(a * y, b * x)
	mx2 = max((a - 1 - x) * b, (b - 1 - y) * a)
	print(max(mx1, mx2))


t = int(input())
while t != 0:
	(a, b, x, y) = map(int, input().split())
	p1 = y * a
	p2 = x * b
	p3 = (b - y - 1) * a
	p4 = (a - x - 1) * b
	print(max(p1, p2, p3, p4))
	t = t - 1


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
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):
		(a, b, x, y) = LI()
		r = max(a * max(y, b - y - 1), b * max(x, a - x - 1))
		rr.append(r)
	return JA(rr, '\n')
print(main())


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from functools import cmp_to_key
from heapq import *
from math import gcd, factorial, floor, ceil
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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))
from types import GeneratorType

def iterative(f, stack=[]):

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

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

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

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 ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

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
inf = pow(10, 20)
mod = 10 ** 9 + 7

def solve(case):
	(a, b, x, y) = sep()
	print(max(b * x, b * (a - x - 1), a * y, a * (b - y - 1)))
testcase(int(inp()))