A. Dead Pixel

problem_index: A

time_limit: 1 second

memory_limit: 256 megabytes

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](images/cf_1315_A/1.png)

solutions: ["q = int(input())\nfor u in range(q):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\tif x < a - x - 1:\n\t\tc = a - x - 1\n\telse:\n\t\tc = x\n\tif y < b - y - 1:\n\t\td = b - y - 1\n\telse:\n\t\td = y\n\tif c * b > d * a:\n\t\tprint(c * b)\n\telse:\n\t\tprint(d * a)\n", "for i in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(a * (b - y - 1), (a - x - 1) * b, b * x, a * y))\n", "def main():\n\tfor _ in range(int(input())):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tA = x * b\n\t\tB = (a - x - 1) * b\n\t\tC = a * (b - y - 1)\n\t\tD = a * y\n\t\tif a == 1:\n\t\t\tA = 0\n\t\t\tB = 0\n\t\tif b == 1:\n\t\t\tC = 0\n\t\t\tD = 0\n\t\tprint(max(max(A, B), max(C, D)))\nmain()\n", "N_SETS = int(input())\nfor _ in range(N_SETS):\n\t(h, w, hb, wb) = [int(x) for x in input().split()]\n\tmax_h = max(hb, h - hb - 1)\n\tmax_w = max(wb, w - wb - 1)\n\tprint(max(max_h * max_w, h * max_w, max_h * w))\n", "def solve():\n\t(a, b, x, y) = map(int, input().split())\n\tres = max(max(a * y, b * x), max(a * (b - 1 - y), b * (a - 1 - x)))\n\tprint(res)\nt = eval(input())\nwhile t:\n\tsolve()\n\tt -= 1\n", "def calc(a, b, x, y):\n\treturn max(max(x, a - x - 1) * b, max(y, b - y - 1) * a)\nN = int(input())\ncases = []\nfor _ in range(N):\n\tcases.append(map(int, input().split()))\nfor (a, b, x, y) in cases:\n\tprint(calc(a, b, x, y))\n", "terns = int(input())\nfor i in range(terns):\n\t[a, b, x, y] = [int(l) for l in input().split()]\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\tarr1 = b * x\n\tarr2 = b * (a - x - 1)\n\tarr3 = a * y\n\tarr4 = a * (b - y - 1)\n\tprint(max(arr1, arr2, arr3, arr4))\n", "n = int(input())\ns1 = 0\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tx = max(x, a - 1 - x)\n\ty = max(y, b - 1 - y)\n\tc = max(x * b, a * y)\n\tprint(c)\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tx = x + 1\n\ty = y + 1\n\tui = 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)\n\tif ui < 0:\n\t\tui = 0\n\tprint(ui)\n", "t = int(input())\nwhile t > 0:\n\t(a, b, x, y) = [int(a) for a in input().split()]\n\tprint(max(max(y * a, x * b), max((a - (x + 1)) * b, (b - (y + 1)) * a)))\n\tt = t - 1\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tans = 0\n\tans = max(ans, b * (a - x - 1))\n\tans = max(ans, b * x)\n\tans = max(ans, a * y)\n\tans = max(ans, a * (b - y - 1))\n\tprint(ans)\n", "import sys\nt = int(sys.stdin.readline())\nfor i in range(t):\n\t[a, b, x, y] = [int(j) for j in sys.stdin.readline().split()]\n\tx += 1\n\ty += 1\n\tv1 = (a - x) * b\n\tv2 = (x - 1) * b\n\tv3 = a * (b - y)\n\tv4 = a * (y - 1)\n\tv = max(v1, v2)\n\tv = max(v, v3)\n\tv = max(v, v4)\n\tprint(v)\n", "for tc in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\taa = a - x\n\taaa = x - 1\n\tbb = b - y\n\tbbb = y - 1\n\tprint(max(aa * b, aaa * b, bb * a, bbb * a))\n", "import sys\ninput = sys.stdin.readline\nfor k in range(int(input())):\n\t(a, b, x, y) = map(int, input().split(' '))\n\tprint(max(a * y, b * x, (b - 1 - y) * a, (a - 1 - x) * b))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tc = [(b - y - 1) * a, (a - x - 1) * b, y * a, x * b]\n\tprint(max(c))\n", "def solve():\n\tfor _ in range(int(input())):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tnum1 = x * b\n\t\tnum2 = y * a\n\t\tnum3 = (a - x - 1) * b\n\t\tnum4 = (b - y - 1) * a\n\t\tprint(max(num1, num2, num3, num4))\nsolve()\n", "from sys import stdin\nt = int(stdin.readline())\nwhile t:\n\t(a, b, x, y) = map(int, stdin.readline().split())\n\tprint(max(a * y, a * (b - y - 1), b * x, b * (a - x - 1)))\n\tt -= 1\n", "import re\namount_of_data = int(input())\nlist_a = []\nlist_b = []\nlist_x = []\nlist_y = []\nfor i in range(amount_of_data):\n\tstring = input()\n\tnums = re.findall('\\\\d+', string)\n\tlist_a.append(nums[0])\n\tlist_b.append(nums[1])\n\tlist_x.append(nums[2])\n\tlist_y.append(nums[3])\nfor index in range(len(list_a)):\n\tnew_list = []\n\tnew_list.append(int(list_y[index]) * int(list_a[index]))\n\tnew_list.append(int(list_x[index]) * int(list_b[index]))\n\tnew_list.append((int(list_b[index]) - int(list_y[index]) - 1) * int(list_a[index]))\n\tnew_list.append((int(list_a[index]) - int(list_x[index]) - 1) * int(list_b[index]))\n\tprint(max(new_list))\n", "import sys\nqueries = int(sys.stdin.readline())\nfor query in range(queries):\n\t(columns, rows, x, y) = map(int, sys.stdin.readline().strip().split())\n\tx += 1\n\ty += 1\n\tvar1 = (x - 1) * rows\n\tvar2 = (columns - x) * rows\n\tvar3 = columns * (y - 1)\n\tvar4 = columns * (rows - y)\n\tprint(max(var1, var2, var3, var4))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\ta1 = a * max(b - y - 1, y)\n\ta2 = b * max(a - x - 1, x)\n\tprint(max(a1, a2))\n", "for i in range(int(input())):\n\t(a, b, m, n) = map(int, input().split())\n\tprint(max(a * n, a * (b - 1 - n), b * m, b * (a - 1 - m)))\n", "import sys\ninput = sys.stdin.readline\nfor ti in range(int(input())):\n\t(a, b, x, y) = [int(x) for x in input().strip().split()]\n\tprint(max(x * b, a * y, (a - x - 1) * b, a * (b - y - 1)))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = [int(s) for s in input().split()]\n\tr1 = b * x\n\tr2 = a * y\n\tr3 = (a - x - 1) * b\n\tr4 = (b - y - 1) * a\n\tprint(max(r1, r2, r3, r4))\n", "def checker(a, b, x, y):\n\tp = x if x >= a - 1 - x else a - 1 - x\n\tq = y if y >= b - 1 - y else b - 1 - y\n\t(a1, a2) = (p * b, q * a)\n\treturn a1 if a1 >= a2 else a2\nfor _ in range(int(input())):\n\t(A, B, X, Y) = [int(i) for i in input().split()]\n\tprint(checker(A, B, X, Y))\n", "t = int(input())\nfor _ in range(t):\n\t(m, n, a, b) = map(int, input().split())\n\ta = max(m - a - 1, a)\n\tb = max(n - b - 1, b)\n\tprint(max(m * b, n * a))\n", "t = int(input())\nfor i in range(0, t):\n\ts = input().split(' ')\n\ta = int(s[0])\n\tb = int(s[1])\n\tx = int(s[2])\n\ty = int(s[3])\n\tmas = [(a - x - 1) * b, x * b, (b - y - 1) * a, y * a]\n\tprint(max(mas))\n", "def machine(li):\n\tlistresult = []\n\tf = li[0]\n\tc = li[1]\n\tx = li[2]\n\ty = li[3]\n\tr = calcrigth(c, y)\n\tl = calcleft(c, r)\n\td = calcdown(f, x)\n\tu = calcup(f, d)\n\ttr = f * r\n\tlistresult.append(tr)\n\ttl = f * l\n\tlistresult.append(tl)\n\ttd = c * d\n\tlistresult.append(td)\n\ttu = c * u\n\tlistresult.append(tu)\n\treturn max(listresult)\n\ndef calcrigth(c, y):\n\treturn c - y - 1\n\ndef calcleft(c, r):\n\treturn c - r - 1\n\ndef calcup(f, d):\n\treturn f - d - 1\n\ndef calcdown(f, x):\n\treturn f - x - 1\nmilist = []\nlistint = []\nt = int(input())\nfor i in range(t):\n\tlistnum = []\n\tmilist = input().split()\n\tfor nums in milist:\n\t\tlistnum.append(int(nums))\n\tlistint.append(listnum)\nfor i in range(t):\n\tprint(machine(listint[i]))\n", "for i in range(int(input())):\n\t(a, b, c, d) = map(int, input().split())\n\tk = a * d\n\tl = b * c\n\tm = b * (a - c - 1)\n\tn = a * (b - d - 1)\n\tprint(max(k, l, m, n))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\ta1 = x * b\n\ta2 = b * (a - x - 1)\n\ta3 = a * y\n\ta4 = a * (b - y - 1)\n\tprint(max(a1, a2, a3, a4))\n", "def foo():\n\t(a, b, x, y) = list(map(int, input().split()))\n\tx += 1\n\ty += 1\n\tprint(max((a - x) * b, a * (b - y), (x - 1) * b, (y - 1) * a))\nt = int(input())\nfor i in range(t):\n\tfoo()\n", "ilosc = int(input())\ntab = []\nfor i in range(ilosc):\n\t(a, b, xa, xb) = [int(x) for x in input().split()]\n\ttab.append(max((a - (xa + 1)) * b, xb * a, xa * b, (b - (xb + 1)) * a))\nfor j in range(len(tab)):\n\tprint('\\n', tab[j])\n", "import sys\ninput = sys.stdin.readline\n\ndef main():\n\tt = int(input())\n\tfor _ in range(t):\n\t\t(A, B, X, Y) = [int(x) for x in input().split()]\n\t\tma = 0\n\t\tma = max(X * B, ma)\n\t\tma = max(Y * A, ma)\n\t\tma = max((A - X - 1) * B, ma)\n\t\tma = max((B - Y - 1) * A, ma)\n\t\tprint(ma)\nmain()\n", "t = int(input())\nwhile t > 0:\n\tt = t - 1\n\t(a, b, x, y) = map(int, input().split())\n\tone = y * a\n\ttwo = x * b\n\tthree = (a - 1 - (x + 1) + 1) * b\n\tfour = (b - 1 - (y + 1) + 1) * a\n\tprint(max(one, two, three, four))\n", "for test_c in range(int(input())):\n\t(x, y, a, b) = map(int, input().split())\n\tif a + 1 <= x / 2:\n\t\ta = x - a - 1\n\tif b + 1 <= y / 2:\n\t\tb = y - b - 1\n\tif a * y > b * x:\n\t\tprint(a * y)\n\telse:\n\t\tprint(b * x)\n", "import math\nimport sys\ninput = sys.stdin.readline\n\ndef print(x, end='\\n'):\n\tsys.stdout.write(str(x) + end)\nt = int(input())\nwhile t:\n\tt -= 1\n\t(a, b, x, y) = map(int, input().split())\n\tarea = max(x * b, a * y)\n\tarea1 = max((a - x - 1) * b, a * (b - y - 1))\n\tprint(max(area, area1))\n", "t = int(input())\nwhile t:\n\tt = t - 1\n\t(a, b, x, y) = map(int, input().split())\n\tif x >= a // 2:\n\t\tl1 = x\n\telse:\n\t\tl1 = a - x - 1\n\tarea1 = l1 * b\n\tif y >= b // 2:\n\t\tl2 = y\n\telse:\n\t\tl2 = b - y - 1\n\tarea2 = l2 * a\n\tprint(max(area1, area2))\n", "t = int(input())\nans = []\nfor i in range(t):\n\tls = [int(ls) for ls in input().split()]\n\t(a, b, x, y) = (ls[0], ls[1], ls[2], ls[3])\n\tans.append(max(a * (b - 1 - y), a * y, b * (a - x - 1), b * x))\nfor i in ans:\n\tprint(i)\n", "number_of_testcase = int(input())\n\ndef greater(m, n):\n\tif m > n:\n\t\treturn m\n\telse:\n\t\treturn n\nfor i in range(number_of_testcase):\n\t(a, b, x, y) = list(map(int, input().split(' ')))\n\tlarger_x = greater(a - 1 - x, x)\n\tlarger_y = greater(b - 1 - y, y)\n\tresult = greater(larger_x * b, larger_y * a)\n\tprint(result)\n", "t = int(input())\nwhile t > 0:\n\t(a, b, x, y) = map(int, input().split())\n\ts1 = x * b\n\ts2 = (a - x - 1) * b\n\ts3 = y * a\n\ts4 = (b - y - 1) * a\n\tans = max(s1, s2, s3, s4)\n\tprint(ans)\n\tt -= 1\n", "import sys\n\ndef main():\n\t(a, b, x, y) = [int(i) for i in sys.stdin.readline().split()]\n\tprint(max(max(y * a, (b - y - 1) * a), max(x * b, (a - x - 1) * b)))\nfor test in range(int(sys.stdin.readline())):\n\tmain()\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tv = (a - x - 1) * b\n\tv1 = (b - y - 1) * a\n\tv2 = x * b\n\tv3 = y * a\n\tc = max(v, v1, v2, v3)\n\tprint(c)\n", "def f():\n\tl1 = input().split(' ')\n\ta = int(l1[0])\n\tb = int(l1[1])\n\tx = int(l1[2]) + 1\n\ty = int(l1[3]) + 1\n\tm = max((a - x) * b, (x - 1) * b, (b - y) * a, (y - 1) * a)\n\tprint(m)\n\treturn 0\nrow = int(input())\nfor r in range(row):\n\tf()\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\ts1 = max((a - x - 1) * b, x * b)\n\ts2 = max((b - y - 1) * a, y * a)\n\tprint(max(s1, s2))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, c, d) = [int(x) for x in input().split()]\n\tprint(max(max(c, a - 1 - c) * b, max(d, b - 1 - d) * a))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tl = max(a * y, a * (b - y - 1))\n\tll = max(b * x, b * (a - x - 1))\n\tprint(max(l, ll))\n", "t = int(input())\nfor T in range(t):\n\t(a, b, x, y) = list(map(int, input().split()))\n\ta1 = a2 = a3 = a4 = 0\n\ta1 = x * b\n\ta2 = (a - (x + 1)) * b\n\ta3 = y * a\n\ta4 = (b - (y + 1)) * a\n\tprint(max(a1, a2, a3, a4))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tx = x + 1\n\ty = y + 1\n\tc = (x - 1) * b\n\td = (a - x) * b\n\te = a * (y - 1)\n\tf = a * (b - y)\n\tprint(max(c, d, e, f))\n", "testCase = int(input())\nfor i1 in range(testCase):\n\tparameters = list(map(int, input().split()))\n\tparameters[0] -= 1\n\tparameters[1] -= 1\n\tarea = [0] * 4\n\tarea[0] = (parameters[0] + 1) * (parameters[1] - parameters[3])\n\tarea[1] = (parameters[0] + 1) * parameters[3]\n\tarea[2] = (parameters[1] + 1) * (parameters[0] - parameters[2])\n\tarea[3] = (parameters[1] + 1) * parameters[2]\n\tprint(max(area))\n", "def cal(y1, x1, y2, x2):\n\tif y1 <= y2 and x1 <= x2:\n\t\treturn (y2 - y1 + 1) * (x2 - x1 + 1)\n\telse:\n\t\treturn 0\nt = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tans = 0\n\tans = max(ans, cal(0, 0, x - 1, b - 1))\n\tans = max(ans, cal(x + 1, 0, a - 1, b - 1))\n\tans = max(ans, cal(0, 0, a - 1, y - 1))\n\tans = max(ans, cal(0, y + 1, a - 1, b - 1))\n\tprint(ans)\n", "for _ in range(int(input())):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\tl = (b - (y + 1)) * a\n\tr = y * a\n\td = (a - (x + 1)) * b\n\tu = x * b\n\tprint(max([l, r, d, u]))\n", "n = int(input())\nfor i in range(n):\n\ta = str(input())\n\ta = a.split(' ')\n\ts1 = int(a[0]) * int(a[3])\n\ts2 = int(a[1]) * int(a[2])\n\ts3 = (int(a[1]) - int(a[3]) - 1) * int(a[0])\n\ts4 = (int(a[0]) - int(a[2]) - 1) * int(a[1])\n\tprint(max(s1, s2, s3, s4))\n", "def area(data):\n\tlx = data[0]\n\tly = data[1]\n\tx = data[2] + 1\n\ty = data[3] + 1\n\tif lx - x < x:\n\t\tans1 = (x - 1) * ly\n\telse:\n\t\tans1 = (lx - x) * ly\n\tif ly - y < y:\n\t\tans2 = (y - 1) * lx\n\telse:\n\t\tans2 = (ly - y) * lx\n\treturn max(ans1, ans2)\nn = int(input())\ndata = []\nanswer = []\nfor i in range(0, n):\n\tdata = list(map(int, input().split()))\n\tanswer.append(area(data))\nfor i in range(0, len(answer)):\n\tprint(answer[i])\n", "import sys\n\ndef techo(num):\n\tif float(num) - int(num) != 0:\n\t\treturn int(num) + 1\n\telse:\n\t\treturn num\nt = int(input())\nfor case in range(t):\n\tline = sys.stdin.readline().strip().split(' ')\n\ta = int(line[0])\n\tb = int(line[1])\n\tx = int(line[2])\n\ty = int(line[3])\n\tif x + 1 > techo(float(a) / 2):\n\t\tif y + 1 > techo(float(b) / 2):\n\t\t\tif x * b > a * y:\n\t\t\t\tprint(x * b)\n\t\t\telse:\n\t\t\t\tprint(a * y)\n\t\telif x * b > a * (b - (y + 1)):\n\t\t\tprint(x * b)\n\t\telse:\n\t\t\tprint(a * (b - (y + 1)))\n\telif y + 1 > techo(float(b) / 2):\n\t\tif (a - x - 1) * b > a * y:\n\t\t\tprint((a - x - 1) * b)\n\t\telse:\n\t\t\tprint(a * y)\n\telif (a - 1 - x) * b > a * (b - 1 - y):\n\t\tprint((a - 1 - x) * b)\n\telse:\n\t\tprint(a * (b - 1 - y))\n", "T = int(input())\nfor i in range(0, T):\n\tls = list(map(int, input().split()))\n\tw1 = max(ls[1] - ls[3] - 1, ls[3])\n\tl1 = max(ls[0] - ls[2] - 1, ls[2])\n\tprint(max(w1 * ls[0], l1 * ls[1]))\n", "test_cases = int(input())\nfor test in range(test_cases):\n\t(w, l, x, y) = input().split()\n\tw = int(w)\n\tl = int(l)\n\tx = int(x)\n\ty = int(y)\n\twidth_choice = max(w - x - 1, x - 0)\n\tlength_choice = max(l - y - 1, y - 0)\n\tbest_area = max(width_choice * l, length_choice * w)\n\tprint(best_area)\n", "for _ in range(int(input())):\n\ttmp = [int(x) for x in input().split()]\n\t(a, b, x, y) = (tmp[0], tmp[1], tmp[2], tmp[3])\n\ttmpl = [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]\n\tprint(max(tmpl))\n", "from sys import stdin\n\ndef solve(a, b, x, y):\n\tans = max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a)\n\treturn ans\n\ndef main():\n\tt = int(stdin.readline().strip())\n\tfor _ in range(t):\n\t\t(a, b, x, y) = map(int, stdin.readline().strip().split())\n\t\tprint(solve(a, b, x, y))\nmain()\n", "import sys\ninput = sys.stdin.readline\nfrom collections import defaultdict as dd\nt = int(input())\nwhile t:\n\t(x, y, a, b) = map(int, input().split())\n\ta1 = b * x\n\ta2 = a * y\n\ta3 = (x - a - 1) * y\n\ta4 = (y - b - 1) * x\n\tprint(max(a1, a2, a3, a4))\n\tt -= 1\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\t(x, y) = (x + 1, y + 1)\n\tif a == 1:\n\t\tprint(max(b - y, y - 1))\n\telif b == 1:\n\t\tprint(max(a - x, x - 1))\n\telse:\n\t\tr = a * (y - 1)\n\t\tr = max(r, b * (x - 1))\n\t\tr = max(r, (b - y) * a)\n\t\tr = max(r, (a - x) * b)\n\t\tprint(r)\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = [int(x) for x in input().split()]\n\tc = max(x, a - x - 1) * b\n\td = a * max(y, b - y - 1)\n\tprint(max(c, d))\n", "t = int(input())\nfor t1 in range(t):\n\tline = input()\n\t(a, b, x, y) = (int(x) for x in line.split())\n\toptions = [a * (b - y - 1), b * (a - x - 1), a * y, b * x]\n\tprint(max(options))\n", "def main():\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\tup = (x - 1) * b\n\tdown = (y - 1) * a\n\tif a - x > 0:\n\t\tleft = (a - x) * b\n\telse:\n\t\tleft = 0\n\tif b - y > 0:\n\t\tright = (b - y) * a\n\telse:\n\t\tright = 0\n\tprint(max(up, down, left, right))\n\treturn\n\ndef test():\n\tt = int(input())\n\twhile t:\n\t\tmain()\n\t\tt -= 1\n\treturn\ntest()\n", "for _ in range(int(input())):\n\t(a, b, y, x) = map(int, input().split())\n\tlc = y - 0\n\tif y == 0:\n\t\tlr = 0\n\telse:\n\t\tlr = b\n\tif y == a - 1:\n\t\trr = 0\n\telse:\n\t\trr = b\n\trc = a - 1 - y\n\tif x == b - 1:\n\t\tdwc = 0\n\t\tdwr = 0\n\telse:\n\t\tdwc = a\n\t\tdwr = b - 1 - x\n\tif x == 0:\n\t\tupr = 0\n\t\tupc = 0\n\telse:\n\t\tupr = x - 0\n\t\tupc = a\n\tprint(max(lr * lc, rr * rc, dwr * dwc, upr * upc))\n", "def get_result(length, height, x, y):\n\tl1 = x - 1\n\tl2 = length - x\n\th1 = height - y\n\th2 = y - 1\n\ts1 = h1 * l1\n\ts2 = h1 * l2\n\ts3 = h2 * l1\n\ts4 = h2 * l2\n\treturn max(s1 + s2 + h1, s1 + s3 + l1, s3 + s4 + h2, s2 + s4 + l2)\ncount = int(input())\nresults = []\nfor i in range(count):\n\t(a, b, c, d) = map(int, input().split())\n\tresult = get_result(a, b, c + 1, d + 1)\n\tresults.append(result)\nfor i in results:\n\tprint(i)\n", "import sys\nimport math\nget_string = lambda : sys.stdin.readline().strip()\nget_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))\nget_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))\nget_charList_from_str = lambda : list(sys.stdin.readline().strip())\nget_char_list = lambda : sys.stdin.readline().strip().split()\nget_int = lambda : int(sys.stdin.readline())\npt = lambda x: sys.stdout.write(str(x))\nfor _ in range(get_int()):\n\t(a, b, x, y) = get_int_list()\n\tarea = max((a - x - 1) * b, x * b, y * a, (b - y - 1) * a)\n\tprint(area)\n", "for i in range(int(input())):\n\t(a, b, c, d) = map(int, input().split())\n\tprint(max(max(c, a - c - 1) * b, max(d, b - d - 1) * a))\n", "t = int(input())\nwhile t > 0:\n\t(a, b, x, y) = map(int, input().split())\n\tans = max((a - x - 1) * b, x * b, (b - y - 1) * a, y * a)\n\tprint(ans)\n\tt -= 1\n", "def solve(a, b, x, y):\n\ti = max(x, a - 1 - x)\n\tans = i * b\n\ti = max(y, b - 1 - y)\n\tans = max(ans, i * a)\n\tprint(ans)\n\ndef main():\n\tinp = lambda : [int(x) for x in input().split()]\n\ttc = int(input())\n\tfor _ in range(tc):\n\t\t(a, b, x, y) = inp()\n\t\tsolve(a, b, x, y)\nmain()\n", "test = int(input())\nfor x in range(test):\n\t(x, y, dx, dy) = map(int, input().split())\n\tleft = dx * y\n\tbottom = (x - 1 - dx) * y\n\tright = (y - 1 - dy) * x\n\ttop = dy * x\n\tprint(max(top, left, right, bottom))\n", "import sys\nimport math\nfrom collections import defaultdict\nfrom collections import deque\nfrom itertools import combinations\nfrom itertools import permutations\ninput = lambda : sys.stdin.readline().rstrip()\nread = lambda : list(map(int, input().split()))\ngo = lambda : 1 / 0\n\ndef write(*args, sep='\\n'):\n\tfor i in args:\n\t\tsys.stdout.write('{}{}'.format(i, sep))\nINF = float('inf')\nMOD = int(1000000000.0 + 7)\nYES = 'YES'\nNO = 'NO'\nfor _ in range(int(input())):\n\ttry:\n\t\t(a, b, x, y) = read()\n\t\tup = y * a\n\t\tdown = (b - y - 1) * a\n\t\tleft = x * b\n\t\tright = (a - x - 1) * b\n\t\tprint(max([up, down, left, right]))\n\texcept ZeroDivisionError:\n\t\tcontinue\n\texcept Exception as e:\n\t\tprint(e)\n\t\tcontinue\n", "for tc in range(0, int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tmx = max((b - (y + 1)) * a, b * x, a * y, b * (a - (x + 1)))\n\tprint(mx)\n", "import sys, math, cmath, time\nstart_time = time.time()\n\ndef solve():\n\t(a, b, x, y) = invr()\n\tq = max(a - x - 1, x)\n\tw = max(b - y - 1, y)\n\tprint(max(q * b, w * a))\n\ndef main():\n\tglobal tt\n\tif not ONLINE_JUDGE:\n\t\tsys.stdin = open('input.txt', 'r')\n\t\tsys.stdout = open('output.txt', 'w')\n\tt = 1\n\tt = inp()\n\tfor tt in range(t):\n\t\tsolve()\n\tif not ONLINE_JUDGE:\n\t\tprint('Time Elapsed :', time.time() - start_time, 'seconds')\n\t\tsys.stdout.close()\n\ndef inp():\n\treturn int(input())\n\ndef inlt():\n\treturn list(map(int, input().split()))\n\ndef insr():\n\treturn input().strip()\n\ndef invr():\n\treturn map(int, input().split())\n\ndef counter(a):\n\tq = [0] * max(a)\n\tfor i in range(len(a)):\n\t\tq[a[i] - 1] = q[a[i] - 1] + 1\n\treturn q\n\ndef counter_elements(a):\n\tq = dict()\n\tfor i in range(len(a)):\n\t\tif a[i] not in q:\n\t\t\tq[a[i]] = 0\n\t\tq[a[i]] = q[a[i]] + 1\n\treturn q\n\ndef string_counter(a):\n\tq = [0] * 26\n\tfor i in range(len(a)):\n\t\tq[ord(a[i]) - 97] = (q[ord(a[i]) - 97], 1)\n\treturn q\n\ndef factors(n):\n\tq = []\n\tfor i in range(1, int(n ** 0.5) + 1):\n\t\tif n % i == 0:\n\t\t\tq.append(i)\n\t\t\tq.append(n // i)\n\treturn list(sorted(list(set(q))))\n\ndef prime_factors(n):\n\tq = []\n\twhile n % 2 == 0:\n\t\tq.append(2)\n\t\tn = n // 2\n\tfor i in range(3, int(n ** 0.5) + 1, 2):\n\t\twhile n % i == 0:\n\t\t\tq.append(i)\n\t\t\tn = n // i\n\tif n > 2:\n\t\tq.append(n)\n\treturn list(sorted(q))\n\ndef transpose(a):\n\t(n, m) = (len(a), len(a[0]))\n\tb = [[0] * n for i in range(m)]\n\tfor i in range(m):\n\t\tfor j in range(n):\n\t\t\tb[i][j] = a[j][i]\n\treturn b\nONLINE_JUDGE = __debug__\nif ONLINE_JUDGE:\n\tinput = sys.stdin.readline\nmain()\n", "t = int(input())\nwhile t:\n\tt += -1\n\t(a, b, x, y) = map(int, input().split())\n\ta1 = b * x\n\ta2 = a * y\n\ta3 = b * (a - x - 1)\n\ta4 = a * (b - y - 1)\n\tprint(max(a1, a2, a3, a4))\n", "t = int(input())\nu = []\nfor i in range(0, t):\n\ta = [int(i) for i in input().split()]\n\ts1 = a[2] * a[1]\n\ts2 = a[3] * a[0]\n\ts3 = (a[0] - a[2] - 1) * a[1]\n\ts4 = (a[1] - a[3] - 1) * a[0]\n\td = [s1, s2, s3, s4]\n\tu.append(max(d))\nfor i in u:\n\tprint(i)\n", "kl = int(input())\nfor l in range(kl):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\tprint(max(a * y, a * (b - y - 1), b * x, b * (a - x - 1)))\n", "for _ in range(int(input())):\n\ta = list(map(int, input().split()))\n\tans = max(max(a[2], a[0] - 1 - a[2]) * a[1], max(a[3], a[1] - 1 - a[3]) * a[0])\n\tprint(ans)\n", "l = input()\nk = int(l)\nfor i in range(0, k):\n\t(a, b, x, y) = map(int, input().split())\n\tx = x + 1\n\ty = y + 1\n\tr1 = (x - 1) * b\n\tr2 = a * (b - y)\n\tr3 = (y - 1) * a\n\tr4 = (a - x) * b\n\tprint(max(max(r1, r2), max(r3, r4)))\n", "def dead_pixel(a, b, x, y):\n\th = a * max(y, b - y - 1)\n\tv = b * max(x, a - x - 1)\n\treturn max(h, v)\nt = int(input())\nfor _ in range(t):\n\tprint(dead_pixel(*map(int, input().split())))\n", "t = int(input())\ntest_list = []\nans = []\nfor i in range(0, t):\n\tcase = input()\n\ttest_list.append(case.split())\nfor j in test_list:\n\ta = int(j[0])\n\tb = int(j[1])\n\tx = int(j[2])\n\ty = int(j[3])\n\tfirst = a * y\n\tsecond = b * x\n\tthird = a * (b - (y + 1))\n\tfourth = b * (a - (x + 1))\n\tmax_list = [first, second, third, fourth]\n\tans.append(max(max_list))\nfor i in ans:\n\tprint(i)\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tmax_x = max(x, a - 1 - x)\n\tmax_y = max(y, b - 1 - y)\n\tprint(max(max_x * b, max_y * a))\n", "t = int(input())\nfor i in range(t):\n\tw = list(map(int, input().split(' ')))\n\tmaxi = 0\n\tarea = w[0] * w[3]\n\tif area > maxi:\n\t\tmaxi = area\n\tarea = w[1] * w[2]\n\tif area > maxi:\n\t\tmaxi = area\n\tarea = w[0] * (w[1] - w[3] - 1)\n\tif area > maxi:\n\t\tmaxi = area\n\tarea = w[1] * (w[0] - w[2] - 1)\n\tif area > maxi:\n\t\tmaxi = area\n\tprint(maxi)\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = list(map(int, input().split()))\n\ta1 = (a - x - 1) * b\n\ta2 = (b - y - 1) * a\n\ta3 = y * a\n\ta4 = x * b\n\tif a3 == a * b:\n\t\ta3 = 0\n\tif a4 == b * a:\n\t\ta4 = 0\n\tg = max(a1, a2, a3, a4)\n\tprint(g)\n", "def perimeter(p1, p2):\n\td1 = p2[0] - p1[0] + 1\n\td2 = p2[1] - p1[1] + 1\n\treturn d1 * d2\n\ndef main():\n\tno_of_screens = int(input())\n\tfor _ in range(no_of_screens):\n\t\t(a, b, x, y) = [int(elem) for elem in input().split()]\n\t\tx += 1\n\t\ty += 1\n\t\tleft_up = (1, 1)\n\t\tleft_down = (0, b)\n\t\tright_up = (a, 0)\n\t\tright_down = (a, b)\n\t\tabove_dead_pixel = (left_up, (a, y - 1))\n\t\tbelow_dead_pixel = ((1, y + 1), right_down)\n\t\tright_dead_pixel = ((x + 1, 1), right_down)\n\t\tleft_dead_pixel = (left_up, (x - 1, b))\n\t\tp1 = perimeter(*above_dead_pixel)\n\t\tp2 = perimeter(*below_dead_pixel)\n\t\tp3 = perimeter(*right_dead_pixel)\n\t\tp4 = perimeter(*left_dead_pixel)\n\t\tprint(max([p1, p2, p3, p4]))\nmain()\n", "import math\nnumberTests = int(input())\nfor n in range(numberTests):\n\tline = input()\n\tmaximous = []\n\t(height, width, y, x) = map(int, line.split())\n\tdistanceDerecha = abs(width - x - 1)\n\tmaximous.append(distanceDerecha * height)\n\tmaximous.append(x * height)\n\tdistanciaAbajo = abs(height - y - 1)\n\tmaximous.append(distanciaAbajo * width)\n\tmaximous.append(y * width)\n\tprint(max(maximous))\n", "T = int(input().strip())\ndebug = False\nfor t in range(T):\n\t(a, b, x, y) = map(int, input().split())\n\tif 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):\n\t\tprint(max((a - 1) * b, a * (b - 1)))\n\telif (x == 0 or x == a - 1) and 0 < y < b - 1:\n\t\tprint(max((a - 1) * b, a * y, a * (b - (y + 1))))\n\telif (y == 0 or y == b - 1) and 0 < x < a - 1:\n\t\tprint(max(a * (b - 1), b * x, b * (a - (x + 1))))\n\telse:\n\t\tprint(max(a * y, a * (b - (y + 1)), b * x, b * (a - (x + 1))))\n", "def max_area(a, b, x, y):\n\treturn max([(a - x - 1) * b, a * (b - y - 1), x * b, y * a])\nfor _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max_area(a, b, x, y))\n", "from bisect import bisect_left as bl, bisect_right as br, insort\nimport sys\nimport heapq\nfrom math import *\nfrom collections import defaultdict as dd, deque\n\ndef data():\n\treturn sys.stdin.readline().strip()\n\ndef mdata():\n\treturn map(int, data().split())\nfor i in range(int(input())):\n\t(a, b, x, y) = mdata()\n\tprint(max(max(a - x - 1, x) * b, max(b - y - 1, y) * a))\n", "import sys\nn = int(sys.stdin.readline())\nfor _ in range(n):\n\t(a, b, x, y) = [int(d) for d in sys.stdin.readline().split()]\n\ts = max([x * b, (a - x - 1) * b, a * y, a * (b - y - 1)])\n\tprint(s)\n", "for ul in range(int(input())):\n\t(a, b, x, y) = [int(x) for x in input().split()]\n\ta1 = b * (x - 0)\n\ta2 = b * (a - x - 1)\n\ta3 = a * (y - 0)\n\ta4 = a * (b - y - 1)\n\tprint(max(a1, a2, a3, a4))\n", "import math, collections, sys\ninput = sys.stdin.readline\n\ndef solve():\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(x * b, (a - 1 - x) * b, y * a, (b - 1 - y) * a))\nfor _ in range(int(input())):\n\tsolve()\n", "t = int(input())\nwhile t > 0:\n\t(m, n, x, y) = [int(x) for x in input().split(' ')]\n\tx += 1\n\ty += 1\n\ta = (y - 1) * m\n\tb = (n - y) * m\n\tc = (x - 1) * n\n\td = (m - x) * n\n\tif a > b and a > c and (a > d):\n\t\tprint(a)\n\telif b > c and b > d:\n\t\tprint(b)\n\telif c > d:\n\t\tprint(c)\n\telse:\n\t\tprint(d)\n\tt -= 1\n", "t = int(input())\nresult = []\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tk = max(b * x, b * (a - x - 1), a * y, a * (b - y - 1))\n\tresult.append(k)\nfor i in range(t):\n\tprint(result[i])\n", "import sys\nreader = (s.rstrip() for s in sys.stdin)\ninput = reader.__next__\n\ndef gift():\n\tfor _ in range(t):\n\t\t(a, b, x, y) = [int(x) for x in input().split()]\n\t\ts1 = a * (b - y - 1)\n\t\ts2 = a * y\n\t\ts3 = b * (a - x - 1)\n\t\ts4 = b * x\n\t\tyield max([s1, s2, s3, s4])\nt = int(input())\nans = gift()\nprint(*ans, sep='\\n')\n", "for _ in range(int(input())):\n\t(r, c, x, y) = map(int, input().split())\n\tl = [(c - 1 - y) * r, y * r, x * c, (r - 1 - x) * c]\n\tprint(max(l))\n", "import sys\ninput = sys.stdin.readline\nfor _ in range(int(input())):\n\t(a, b, m, n) = map(int, input().split())\n\tprint(max(max(m, a - m - 1) * b, max(n, b - n - 1) * a))\n", "t = int(input())\nfor you in range(t):\n\tl = input().split()\n\ta = int(l[0])\n\tb = int(l[1])\n\tx = int(l[2])\n\ty = int(l[3])\n\tx = x + 1\n\ty = y + 1\n\tprint(max((x - 1) * b, (a - x) * b, a * (y - 1), a * (b - y)))\n", "for _ in [*open(0)][1:]:\n\t(a, b, x, y) = map(int, _.split())\n\tprint(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tl = (a - x - 1) * b\n\tr = x * b\n\tu = y * a\n\td = (b - y - 1) * a\n\tprint(f'{max(l, r, u, d)}')\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tda = a - x - 1\n\tif da < x:\n\t\tda = x\n\tdb = b - y - 1\n\tif db < y:\n\t\tdb = y\n\tif da * b >= a * db:\n\t\tprint(da * b)\n\telse:\n\t\tprint(a * db)\n", "from sys import stdin\n\ndef main():\n\tk = [int(i) for i in stdin.read().split()]\n\tt = k[0]\n\tfor i in range(t):\n\t\t(a, b, x, y) = (k[1 + i * 4], k[2 + i * 4], k[3 + i * 4], k[4 + i * 4])\n\t\tprint(max(b * max(x, a - x - 1), a * max(y, b - y - 1)))\nmain()\n", "for _ in range(int(input())):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\tx += 1\n\ty += 1\n\tm1 = 0\n\tm2 = 0\n\tif a == 1:\n\t\tm1 = max(y - 1, b - y)\n\telif b == 1:\n\t\tm2 = max(x - 1, a - x)\n\telse:\n\t\tm1 = a * max(y - 1, b - y)\n\t\tm2 = b * max(x - 1, a - x)\n\tprint(max(m1, m2))\n", "from sys import stdin\ninput = stdin.readline\nt = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tprint(max(x * b, a * (b - 1 - y), y * a, b * (a - 1 - x)))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\ttotal = a * b\n\tleft = x * b\n\tright = total - left - b\n\tdown = a * y\n\tup = total - down - a\n\tprint(max(left, right, down, up))\n", "def matchArea(w, h, x, y):\n\txArea = x * h if x + 1 > w / 2 else (w - x - 1) * h\n\tyArea = y * w if y + 1 > h / 2 else (h - y - 1) * w\n\treturn xArea if xArea > yArea else yArea\nn = int(input())\ns = ''\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split(' '))\n\ts += str(matchArea(a, b, x, y)) + '\\n'\nprint(s[0:-1])\n", "for _ in range(int(input())):\n\t(n, m, a, b) = map(int, input().split())\n\tif a >= n / 2:\n\t\ta = n - a - 1\n\tif b >= m / 2:\n\t\tb = m - b - 1\n\tif (n - a - 1) * m >= (m - b - 1) * n:\n\t\tprint((n - a - 1) * m)\n\telse:\n\t\tprint((m - b - 1) * n)\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tif x >= a // 2:\n\t\tc = a - x\n\t\tc = a - c\n\t\ta1 = c * b\n\tif x < a // 2:\n\t\tc = a - x - 1\n\t\ta1 = c * b\n\tif y < b // 2:\n\t\tc = b - y - 1\n\t\ta2 = c * a\n\tif y >= b // 2:\n\t\tc = y\n\t\ta2 = c * a\n\tprint(max(a1, a2))\n", "for _ in range(int(input())):\n\tlst = list(map(int, input().split(' ')))\n\t(a, b, x, y) = lst\n\tm = [a * (b - y - 1), a * y, b * x, b * (a - x - 1)]\n\tprint(max(m))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tp = max(a * y, a * (b - y - 1))\n\tq = max(b * x, b * (a - x - 1))\n\tprint(max(p, q))\n", "import atexit\nimport io\nimport sys\nimport math\nfrom collections import defaultdict, Counter\nt = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))\n", "for _ in range(int(input())):\n\t(x, y, px, py) = [int(i) for i in input().split()]\n\tmx_p = 0\n\tif x > 0:\n\t\tif y * px > mx_p:\n\t\t\tmx_p = y * px\n\t\tif x > px + 1:\n\t\t\tp = y * (x - (px + 1))\n\t\t\tif p > mx_p:\n\t\t\t\tmx_p = p\n\tif y > 0:\n\t\tif x * py > mx_p:\n\t\t\tmx_p = x * py\n\t\tif y > py + 1:\n\t\t\tp = x * (y - (py + 1))\n\t\t\tif p > mx_p:\n\t\t\t\tmx_p = p\n\tprint(mx_p)\n", "import sys\nfrom collections import defaultdict, deque\ninp = sys.stdin.readline\nread = lambda : list(map(int, inp().split()))\n\ndef a():\n\tans = ''\n\tfor _ in range(read()[0]):\n\t\t(a, b, x, y) = read()\n\t\tx += 1\n\t\ty += 1\n\t\tans += str(max((a - x) * b, (x - 1) * b, a * (b - y), a * (y - 1))) + '\\n'\n\tprint(ans)\na()\n", "def solve():\n\t(R, C, x, y) = map(int, input().split())\n\tmx = max(R * y, x * C)\n\tif y + 1 != C:\n\t\tmx = max(mx, R * (C - y - 1))\n\tif x + 1 != R:\n\t\tmx = max(mx, (R - x - 1) * C)\n\tprint(mx)\nt = int(input())\nfor _ in range(t):\n\tsolve()\n", "n = int(input())\nfor _ in range(n):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tprint(max(a * y, b * x, (a - x - 1) * b, (b - y - 1) * a))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tmax_height = max(a - (x + 1), x)\n\tmax_width = max(b - (y + 1), y)\n\tprint(max(max_height * b, max_width * a))\n", "t = int(input())\nfor tests in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))\n", "T = int(input())\nwhile T > 0:\n\tq = 0\n\tx = [int(x) for x in input().split()]\n\ta = int(x[0])\n\tb = int(x[1])\n\tc = int(x[2])\n\td = int(x[3])\n\tc = c + 1\n\td = d + 1\n\tans = max(a * (d - 1), a * (b - d))\n\tans = max(ans, (a - c) * b)\n\tans = max(ans, (c - 1) * b)\n\tprint(ans)\n\tT = T - 1\n", "t = int(input())\narea = 4 * [0]\nfor iteration in range(t):\n\tinp = input().split()\n\ta = int(inp[0])\n\tb = int(inp[1])\n\tx = int(inp[2])\n\ty = int(inp[3])\n\tarea[0] = x * b\n\tarea[1] = b * (a - x - 1)\n\tarea[2] = a * y\n\tarea[3] = a * (b - y - 1)\n\tprint(max(area))\n", "num_tries = int(input())\nfor i in range(num_tries):\n\t(a, b, x, y) = input().split()\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\tmax_area = max((b - y - 1) * a, y * a, x * b, (a - x - 1) * b)\n\tprint(max_area)\n", "from sys import stdin, stdout\nimport bisect\nimport math\n\ndef st():\n\treturn list(stdin.readline().strip())\n\ndef inp():\n\treturn int(stdin.readline())\n\ndef li():\n\treturn list(map(int, stdin.readline().split()))\n\ndef mp():\n\treturn map(int, stdin.readline().split())\n\ndef pr(n):\n\tstdout.write(str(n) + '\\n')\n\ndef soe(limit):\n\tl = [1] * (limit + 1)\n\tprime = []\n\tfor i in range(2, limit + 1):\n\t\tif l[i]:\n\t\t\tfor j in range(i * i, limit + 1, i):\n\t\t\t\tl[j] = 0\n\tfor i in range(2, limit + 1):\n\t\tif l[i]:\n\t\t\tprime.append(i)\n\treturn prime\n\ndef segsoe(low, high):\n\tlimit = int(high ** 0.5) + 1\n\tprime = soe(limit)\n\tn = high - low + 1\n\tl = [0] * (n + 1)\n\tfor i in range(len(prime)):\n\t\tlowlimit = low // prime[i] * prime[i]\n\t\tif lowlimit < low:\n\t\t\tlowlimit += prime[i]\n\t\tif lowlimit == prime[i]:\n\t\t\tlowlimit += prime[i]\n\t\tfor j in range(lowlimit, high + 1, prime[i]):\n\t\t\tl[j - low] = 1\n\tfor i in range(low, high + 1):\n\t\tif not l[i - low]:\n\t\t\tif i != 1:\n\t\t\t\tprint(i)\n\ndef power(a, n):\n\tr = 1\n\twhile n:\n\t\tif n & 1:\n\t\t\tr = r * a\n\t\t\tn = n - 1\n\t\telse:\n\t\t\ta = a * a\n\t\t\tn = n >> 1\n\treturn r\n\ndef solve():\n\t(a, b, x, y) = mp()\n\tz = max(max(x, a - 1 - x) * b, max(y, b - 1 - y) * a)\n\tpr(z)\nfor _ in range(inp()):\n\tsolve()\n", "t = int(input())\nfor _ in range(t):\n\tarea = 0\n\tinpt = input()\n\tnum = list(map(int, inpt.split()))\n\ta = num[0]\n\tb = num[1]\n\tx = num[2]\n\ty = num[3]\n\tif (a - x - 1) * b >= (b - y - 1) * a and (a - x - 1) * b >= a * y and ((a - x - 1) * b >= b * x):\n\t\tprint((a - x - 1) * b)\n\t\tcontinue\n\telif (b - y - 1) * a >= (a - x - 1) * b and (b - y - 1) * a >= a * y and ((b - y - 1) * a >= b * x):\n\t\tprint((b - y - 1) * a)\n\t\tcontinue\n\telif a * y >= (a - x - 1) * b and a * y >= (b - y - 1) * a and (a * y >= b * x):\n\t\tprint(a * y)\n\t\tcontinue\n\telse:\n\t\tprint(b * x)\n\t\tcontinue\n", "import sys, collections, math, itertools, random, bisect\nINF = sys.maxsize\n\ndef get_ints():\n\treturn map(int, sys.stdin.readline().strip().split())\n\ndef get_array():\n\treturn list(map(int, sys.stdin.readline().strip().split()))\n\ndef input():\n\treturn sys.stdin.readline().strip()\nmod = int(1000000000.0 + 7)\nfor _ in range(int(input())):\n\t(a, b, x, y) = get_ints()\n\tprint(max(max(x, a - 1 - x) * b, a * max(y, b - y - 1)))\n", "case = int(input())\nfor i in range(case):\n\t(a, b, x, y) = (int(v) for v in input().split())\n\tprint(max(x * b, (a - 1 - x) * b, a * y, a * (b - 1 - y)))\n", "t = int(input())\nresult = []\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\tareaArr = [(a - x) * b, a * (b - y), (x - 1) * b, a * (y - 1)]\n\tresult.append(max(areaArr))\nfor x in result:\n\tprint(x)\n", "def s():\n\t(a, b, x, y) = [int(x) for x in input().split(' ')]\n\tres_col = max(a - 1 - x, x)\n\tres_row = max(b - 1 - y, y)\n\tprint(max(res_col * b, res_row * a))\nt = int(input())\nfor i in range(t):\n\ts()\n", "import sys\ninput = sys.stdin.readline\nn = int(input())\nwhile n:\n\tn -= 1\n\t(a, b, x, y) = map(int, input().split())\n\trv = max(x - 0, a - 1 - x)\n\tcv = max(y - 0, b - 1 - y)\n\tprint(max(rv * b, cv * a))\n", "import sys\nimport math\n\ndef read_line():\n\treturn sys.stdin.readline()[:-1]\n\ndef read_int():\n\treturn int(sys.stdin.readline())\n\ndef read_int_line():\n\treturn [int(v) for v in sys.stdin.readline().split()]\nt = read_int()\nfor i in range(t):\n\t(a, b, x, y) = read_int_line()\n\tl = []\n\tl.append(x * b)\n\tl.append(y * a)\n\tl.append((a - 1 - x) * b)\n\tl.append(a * (b - y - 1))\n\tprint(max(l))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tx1 = max(x, a - x - 1)\n\tans1 = x1 * b\n\ty1 = max(y, b - y - 1)\n\tans2 = y1 * a\n\tprint(max(ans1, ans2))\n", "for ti in range(int(input())):\n\t(a, b, x, y) = [int(x) for x in input().strip().split()]\n\tprint(max(x * b, a * y, (a - x - 1) * b, a * (b - y - 1)))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tif x == 0 and y == 0:\n\t\tprint(max((a - 1) * b, a * (b - 1)))\n\t\tcontinue\n\ta1 = x * b\n\ta2 = a * abs(b - y - 1)\n\ta3 = b * abs(a - x - 1)\n\ta4 = a * y\n\tprint(max(a1, a2, a3, a4))\n", "n = int(input())\nwhile n > 0:\n\ts = input().split()\n\ta = int(s[0])\n\tb = int(s[1])\n\tx = int(s[2])\n\ty = int(s[3])\n\ta1 = x * b\n\ta2 = (a - x - 1) * b\n\ta3 = a * y\n\ta4 = a * (b - y - 1)\n\tma1 = max(a1, a2, a3, a4)\n\tprint(ma1)\n\tn -= 1\n", "a = int(input())\narr = []\nfor i in range(a):\n\tarr = [int(x) for x in input().split()]\n\ttx = arr[0]\n\tty = arr[1]\n\tx = arr[2]\n\ty = arr[3]\n\ttemp = [x * ty, (tx - x - 1) * ty, tx * y, tx * (ty - y - 1)]\n\tprint(max(temp))\n", "t = int(input())\nfor i in range(t):\n\t(m, n, x, y) = map(int, input().split())\n\td = []\n\td.append(x * n)\n\td.append((m - 1 - x) * n)\n\td.append(m * y)\n\td.append(m * (n - y - 1))\n\tprint(max(d))\n", "from math import inf\nt = int(input())\nfor q in range(t):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\tprint(max(x * b, (a - x - 1) * b, a * (b - y - 1), a * y))\n", "def calcul_area_max():\n\tl = list(map(int, input().split(' ')))\n\tarea_max = max(l[2] * l[1], (l[1] - (l[3] + 1)) * l[0], (l[0] - (l[2] + 1)) * l[1], l[3] * l[0])\n\tprint(area_max)\nfor _ in range(int(input())):\n\tcalcul_area_max()\n", "import math\nn = int(input())\nfor z in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(x * b, (a - x - 1) * b, a * y, a * (b - y - 1)))\n", "for u in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tk = max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a)\n\tprint(k)\n", "a = int(input())\nfor i in range(a):\n\tarr = [int(x) for x in input().split()]\n\t(a, b, x, y) = (arr[0], arr[1], arr[2], arr[3])\n\tarr = [x * b, (a - x - 1) * b, y * a, (b - y - 1) * a]\n\tarr.sort()\n\tprint(arr[-1])\n", "n = int(input())\nfor _ in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tI = x * b\n\tII = a * y\n\tIII = (a - x - 1) * b\n\tIV = a * (b - y - 1)\n\tprint(max(I, II, III, IV))\n", "def blackPoint():\n\t(a, b, x, y) = list(map(int, input().split()))\n\tdiffX = max(x, a - x - 1)\n\tdiffY = max(y, b - 1 - y)\n\tm1 = diffX * b\n\tm2 = diffY * a\n\tprint(max(m1, m2))\nt = int(input())\nfor i in range(t):\n\tblackPoint()\n", "n = input\nfor _ in [0] * int(n()):\n\ts = list(map(int, n().split()))\n\ta = s[0]\n\tb = s[1]\n\tx = s[2]\n\ty = s[3]\n\ta1 = (b - (y + 1)) * a\n\ta2 = y * a\n\ta3 = x * b\n\ta4 = (a - (x + 1)) * b\n\tprint(max(a1, a2, a3, a4))\n", "def main(a, b, x, y):\n\tsol = max(max(x, a - x - 1) * b, max(y, b - y - 1) * a)\n\tprint(sol)\nn = int(input())\nfor _ in range(n):\n\tlst = list(map(int, input().split()))\n\t(a, b, x, y) = (lst[0], lst[1], lst[2], lst[3])\n\tmain(a, b, x, y)\n", "p = []\nn = int(input())\nfor i in range(n):\n\tl = list(map(int, input().split()))\n\ta = max(l[0] - l[2] - 1, l[0] - (l[0] - l[2]))\n\tb = max(l[1] - l[3] - 1, l[1] - (l[1] - l[3]))\n\t(a, b) = (a * l[1], b * l[0])\n\tk = max(a, b)\n\tp.append(k)\nfor j in p:\n\tprint(j)\n", "from sys import stdin, stdout\nt = int(stdin.readline().strip())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, stdin.readline().split())\n\tans = max(max(x, a - x - 1) * b, max(y, b - y - 1) * a)\n\tstdout.write('{}\\n'.format(ans))\n", "t = int(input())\nfor _ in range(t):\n\tx = list(map(int, input().split()))\n\ta = x[0]\n\tb = x[1]\n\tX = x[2]\n\tY = x[3]\n\ty = [(a - X - 1) * b, X * b, (b - Y - 1) * a, Y * a]\n\tprint(max(y))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\ts1 = max(x, a - x - 1)\n\ts2 = max(y, b - y - 1)\n\tprint(max(s1 * b, s2 * a))\n", "for _ in range(int(input())):\n\tins = [int(x) for x in input().split()]\n\t(a, b, x, y) = (ins[0], ins[1], ins[2] + 1, ins[3] + 1)\n\tr = (a - x) * b\n\tl = (x - 1) * b\n\tu = (b - y) * a\n\td = (y - 1) * a\n\tprint(max(max(l, r), max(u, d)))\n", "for tin in range(int(input())):\n\t(m, n, b, a) = map(int, input().split())\n\tx = (b - 1) * (a - 1)\n\ty = (n - a - 1) * (b - 1)\n\tz = (m - b - 1) * (a - 1)\n\tc = (n - b - 1) * (m - a - 1)\n\td = (m - b - 1) * n\n\te = (n - a - 1) * m\n\tf = b * n\n\tg = a * m\n\tprint(max(x, y, z, c, d, e, f, g))\n", "import os\nimport sys\nfrom io import BytesIO, IOBase\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nfrom math import factorial\nfrom collections import Counter, defaultdict\nfrom heapq import heapify, heappop, heappush\n\ndef RL():\n\treturn map(int, sys.stdin.readline().rstrip().split())\n\ndef N():\n\treturn int(input())\n\ndef comb(n, m):\n\treturn factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0\n\ndef perm(n, m):\n\treturn factorial(n) // factorial(n - m) if n >= m else 0\n\ndef mdis(x1, y1, x2, y2):\n\treturn abs(x1 - x2) + abs(y1 - y2)\nmod = 1000000007\nINF = float('inf')\n\ndef main():\n\tfor _ in range(N()):\n\t\t(a, b, x, y) = RL()\n\t\t(x, y) = (x + 1, y + 1)\n\t\tprint(max([a * (y - 1), a * (b - y), b * (x - 1), b * (a - x)]))\nmain()\n", "for t in range(int(input())):\n\t(r, c, x, y) = map(int, input().split())\n\ta = (c - y - 1) * r\n\tb = (y - 0) * r\n\td = (x - 0) * c\n\te = (r - x - 1) * c\n\tprint(max(a, b, d, e))\n", "n = int(input())\nfor j in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tx = x\n\ty = y\n\txmax = max(a - x, x + 1) - 1\n\tymax = max(b - y, y + 1) - 1\n\tprint(max(a * ymax, xmax * b))\n", "n = int(input())\nfor i in range(n):\n\ts = list(map(int, input().split()))\n\tprint(max(s[0] * s[3], s[0] * (s[1] - s[3] - 1), s[1] * s[2], s[1] * (s[0] - s[2] - 1)))\n", "t = int(input())\nfor test in range(t):\n\t(a, b, x, y) = [int(x) for x in input().split()]\n\tc_x = a - x - 1\n\tc_y = b - y - 1\n\tprint(max(a * y, b * x, a * c_y, b * c_x))\n", "n = int(input())\nc = 0\nl1 = []\nwhile c < n:\n\tl = list(map(int, input().split()))\n\tl[2] = l[2] + 1\n\tl[3] = l[3] + 1\n\tl1.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]])))\n\tc = c + 1\nfor i in l1:\n\tprint(i)\n", "test = int(input())\nfor i in range(test):\n\t(a, b, x, y) = map(int, input().split())\n\tmax_len = max(x, a - x - 1)\n\tarea1 = max_len * b\n\tmax_width = max(y, b - y - 1)\n\tarea2 = max_width * a\n\tarea = max(area1, area2)\n\tprint(f'{area}\\n')\n", "t = int(input())\nabxy = [list(map(int, input().split())) for _ in range(t)]\nfor abxyi in abxy:\n\tai = abxyi[0]\n\tbi = abxyi[1]\n\txi = abxyi[2]\n\tyi = abxyi[3]\n\tamax = max(xi, ai - xi - 1)\n\tbmax = max(yi, bi - yi - 1)\n\tprint(max(amax * bi, ai * bmax))\n", "n = int(input())\nfor a in range(n):\n\tcoords = list(map(int, input().split()))\n\tif coords[0] > 1:\n\t\tside = min(coords[2] + 1, coords[0] - coords[2]) * coords[1]\n\telse:\n\t\tside = coords[0] * coords[1]\n\tif coords[1] > 1:\n\t\tvert = min(coords[3] + 1, coords[1] - coords[3]) * coords[0]\n\telse:\n\t\tvert = coords[0] * coords[1]\n\ttotal = coords[0] * coords[1] - min(vert, side)\n\tprint(total)\n", "def solve(a, b, x, y):\n\tarea1 = a * y\n\tarea2 = a * (b - y - 1)\n\tarea3 = b * x\n\tarea4 = b * (a - x - 1)\n\treturn max(area1, area2, area3, area4)\nT = int(input())\nfor t in range(T):\n\t(a, b, x, y) = tuple(map(int, input().split()))\n\tprint(solve(a, b, x, y))\n", "n = int(input())\nfor i in range(n):\n\t(width, height, x, y) = map(int, input().split())\n\ts1 = x * height\n\ts2 = y * width\n\ts3 = (width - x - 1) * height\n\ts4 = (height - y - 1) * width\n\tprint(max(s1, s2, s3, s4))\n", "l = int(input(''))\nk = []\nfor i in range(l):\n\t(a, b, x, y) = map(int, input('').split())\n\tx += 1\n\ty += 1\n\tm = 0\n\tif a - x >= x:\n\t\tm = a - x\n\telse:\n\t\tm = x - 1\n\tk.append(m * b)\n\tif b - y >= y:\n\t\tm = b - y\n\telse:\n\t\tm = y - 1\n\tk.append(m * a)\nfor i in range(0, len(k), 2):\n\tprint(max(k[i], k[i + 1]))\n", "t = int(input(''))\ntr = [0] * t\nfor x in range(0, t):\n\tnekaj = input('').split()\n\ta = int(nekaj[0])\n\tb = int(nekaj[1])\n\tpa = int(nekaj[2]) + 1\n\tpb = int(nekaj[3]) + 1\n\trezultat = 0\n\trezultat = (a - pa) * b\n\tif rezultat < (b - pb) * a:\n\t\trezultat = (b - pb) * a\n\tif rezultat < (pb - 1) * a:\n\t\trezultat = (pb - 1) * a\n\tif rezultat < (pa - 1) * b:\n\t\trezultat = (pa - 1) * b\n\ttr[x] = rezultat\nfor y in range(0, t):\n\tprint(tr[y])\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tx1 = a - x - 1\n\tx2 = x - 1\n\ty1 = b - y - 1\n\ty2 = y - 1\n\tans1 = max(x1, x2) * b\n\tans2 = max(y1, y2) * a\n\tif x2 >= x1:\n\t\tans1 += b\n\tif y2 >= y1:\n\t\tans2 += a\n\tans = max(ans1, ans2)\n\tprint(ans)\n", "def main():\n\tfrom sys import stdin, stdout\n\tfor _ in range(int(stdin.readline())):\n\t\t(a, b, x, y) = map(int, stdin.readline().split())\n\t\tans = max([x * b, (a - x - 1) * b, y * a, (b - y - 1) * a])\n\t\tstdout.write(str(ans) + '\\n')\nmain()\n", "query = int(input())\nfor _ in range(query):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\t(s1, s2, s3, s4) = (0, 0, 0, 0)\n\ts1 = (y - 1) * a\n\ts2 = (a - x) * b\n\ts3 = (b - y) * a\n\ts4 = (x - 1) * b\n\tprint(max(s1, s2, s3, s4))\n", "tests = int(input())\nfor te in range(tests):\n\t(cols, rows, x, y) = list(map(int, input().split()))\n\tif cols != 1:\n\t\tans = max((x - 0) * rows, (cols - 1 - x) * rows)\n\t\tans = max(ans, cols * (y - 0))\n\t\tans = max(ans, cols * (rows - 1 - y))\n\t\tprint(ans)\n\telse:\n\t\tans = max(y - 0, rows - 1 - y)\n\t\tprint(ans)\n", "import sys\ninput = lambda : sys.stdin.readline().strip()\nfor i in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(a * y, b * x, a * (b - y - 1), b * (a - x - 1)))\n", "from operator import itemgetter\nfrom collections import Counter\n\ndef solve(a, b, x, y):\n\tarea1 = x * b\n\tarea2 = (a - x - 1) * b\n\tarea3 = a * y\n\tarea4 = a * (b - y - 1)\n\tprint(max(area1, area2, area3, area4))\n\ndef main():\n\tt = int(input())\n\tfor i in range(t):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tsolve(a, b, x, y)\n\ndef __starting_point():\n\tmain()\n__starting_point()\n", "t = int(input())\nans_list = []\nfor i in range(t):\n\t(a, b, x, y) = [int(s) for s in input().split(' ')]\n\tans = max(a * (b - y - 1), a * y, b * x, b * (a - x - 1))\n\tans_list.append(ans)\nfor ans in ans_list:\n\tprint(ans)\n", "from sys import stdin\n\ndef main():\n\tt = int(stdin.readline().strip())\n\tfor i in range(t):\n\t\t(a, b, x, y) = [int(y) for y in stdin.readline().strip().split()]\n\t\tprint(max(x * b, (a - 1 - x) * b, a * y, a * (b - 1 - y)))\nmain()\n", "n = int(input())\nfor _ in range(n):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\tprint(max((a - x - 1) * b, x * b, a * (b - y - 1), a * y))\n", "t = int(input())\nsolutions = []\nfor i in range(t):\n\tstring = str(input())\n\tst = string.split()\n\ta = int(st[0])\n\tb = int(st[1])\n\tx = int(st[2])\n\ty = int(st[3])\n\tcase1 = (b - y - 1) * a\n\tcase2 = y * a\n\tcase3 = x * b\n\tcase4 = (a - x - 1) * b\n\tcase = max(case1, case2, case3, case4)\n\tsolutions.append(case)\nfor solution in solutions:\n\tprint(solution)\n", "import os\nimport sys\nfrom io import BytesIO, IOBase\n\ndef main():\n\tpass\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nmain()\n\ndef test():\n\t(a, b, x, y) = map(int, input().split())\n\treturn max(max(x, a - 1 - x) * b, max(y, b - 1 - y) * a)\nt = int(input())\nfor _ in range(t):\n\tprint(test())\n", "t = int(input())\nmatrix = []\n\ndef checkTop(a, y):\n\tbase = 0\n\theight = 0\n\tif y != 0:\n\t\theight += y\n\t\tbase += a\n\treturn base * height\n\ndef checkRight(a, b, x):\n\tbase = 0\n\theight = 0\n\tif x != a:\n\t\tbase += a - 1 - x\n\t\theight += b\n\treturn base * height\n\ndef checkBottom(a, b, y):\n\tbase = 0\n\theight = 0\n\tif y != b:\n\t\theight += b - 1 - y\n\t\tbase += a\n\treturn base * height\n\ndef checkLeft(b, x):\n\tbase = 0\n\theight = 0\n\tif x != 0:\n\t\tbase += x\n\t\theight += b\n\treturn base * height\nif 1 <= t <= 10 ** 4:\n\tfor i in range(0, t):\n\t\tdistance = tuple(input().split())\n\t\ta = int(distance[0])\n\t\tb = int(distance[1])\n\t\tx = int(distance[2])\n\t\ty = int(distance[3])\n\t\tareas = [checkTop(a, y), checkRight(a, b, x), checkBottom(a, b, y), checkLeft(b, x)]\n\t\tprint(max(areas))\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split(' '))\n\tx += 1\n\ty += 1\n\tans_1 = max(a - x, x - 1)\n\tans_1 *= b\n\tans_2 = max(b - y, y - 1)\n\tans_2 *= a\n\tprint(max(ans_1, ans_2))\n", "from functools import reduce\nimport os\nimport sys\nfrom collections import *\nfrom math import *\nfrom bisect import *\nfrom heapq import *\nfrom io import BytesIO, IOBase\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\n\ndef value():\n\treturn tuple(map(int, input().split()))\n\ndef arr():\n\treturn [int(i) for i in input().split()]\n\ndef sarr():\n\treturn [int(i) for i in input()]\n\ndef starr():\n\treturn [str(x) for x in input().split()]\n\ndef inn():\n\treturn int(input())\n\ndef svalue():\n\treturn tuple(map(str, input().split()))\n\ndef parr():\n\treturn [value() for i in range(n)]\nmo = 1000000007\nfor _ in range(inn()):\n\t(a, b, x, y) = value()\n\t(res1, res2, res3, res4) = (-1, -1, -1, -1)\n\t(a, b) = (b, a)\n\tif x - 1 >= 0:\n\t\tres1 = x * a\n\tif x + 1 < b:\n\t\tres2 = (b - x - 1) * a\n\tif y - 1 >= 0:\n\t\tres3 = y * b\n\tif y + 1 < a:\n\t\tres4 = (a - y - 1) * b\n\tprint(max(res1, res2, res3, res4))\n", "num_problems = int(input())\nfor current_problem in range(num_problems):\n\tareas = []\n\tnumbers = []\n\tinp = input()\n\tinp = inp.split(' ')\n\tfor current_number in inp:\n\t\tnumbers.append(int(current_number))\n\twidth = numbers[0]\n\theight = numbers[1]\n\tdead_pixel_x = numbers[2]\n\tdead_pixel_y = numbers[3]\n\tareas.append(max(dead_pixel_y * width, (height - dead_pixel_y - 1) * width))\n\tareas.append(max(dead_pixel_x * height, (width - dead_pixel_x - 1) * height))\n\tprint(max(areas))\n", "from math import *\nzzz = int(input())\nfor zz in range(zzz):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tprint(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))\n", "t = int(input())\nfor ti in range(t):\n\tinp = input().split()\n\t(a, b, x, y) = (int(inp[0]), int(inp[1]), int(inp[2]), int(inp[3]))\n\tprint(max(b * x, b * (a - x - 1), a * y, a * (b - y - 1)))\n", "t = int(input())\na = 0\nb = 0\nx = 0\ny = 0\nfor k in range(t):\n\t(a, b, x, y) = input().split()\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\tif x * b == max([x * b, y * a, (a - 1 - x) * b, (b - 1 - y) * a]):\n\t\tprint(x * b)\n\telif y * a == max([x * b, y * a, (a - 1 - x) * b, (b - 1 - y) * a]):\n\t\tprint(y * a)\n\telif (a - 1 - x) * b == max([x * b, y * a, (a - 1 - x) * b, (b - 1 - y) * a]):\n\t\tprint((a - 1 - x) * b)\n\telse:\n\t\tprint((b - 1 - y) * a)\n", "def sol():\n\tinp = input().split(' ')\n\ttx = int(inp[0])\n\tty = int(inp[1])\n\tx = int(inp[2])\n\ty = int(inp[3])\n\tprint(max(tx * y, tx * (ty - y - 1), ty * x, ty * (tx - x - 1)))\nfor i in range(int(input())):\n\tsol()\n", "import bisect\nimport os\nfrom collections import Counter\nimport bisect\nfrom collections import defaultdict\nimport math\nimport random\nimport heapq as hq\nfrom math import sqrt\nimport sys\nfrom functools import reduce, cmp_to_key\nfrom collections import deque\nimport threading\nfrom itertools import combinations\nfrom io import BytesIO, IOBase\nfrom itertools import accumulate\n\ndef lcm(a, b):\n\treturn a * b // math.gcd(a, b)\n\ndef sort_dict(key_value):\n\treturn sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))\n\ndef list_input():\n\treturn list(map(int, input().split()))\n\ndef num_input():\n\treturn map(int, input().split())\n\ndef string_list():\n\treturn list(input())\n\ndef solve():\n\t(a, b, x, y) = num_input()\n\tprint(max((a - x - 1) * b, x * b, a * y, a * (b - y - 1)))\nt = int(input())\nfor _ in range(t):\n\tsolve()\n", "for u in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tif x >= a - x - 1:\n\t\tn = x\n\telse:\n\t\tn = a - x - 1\n\tif y >= b - y - 1:\n\t\tm = y\n\telse:\n\t\tm = b - y - 1\n\ts1 = n * b\n\ts2 = m * a\n\tprint(max(s1, s2))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tx += 1\n\ty += 1\n\tv1 = (x - 1) * b\n\tv2 = (a - x) * b\n\tv3 = (y - 1) * a\n\tv4 = (b - y) * a\n\tprint(max(v1, v2, v3, v4))\n", "d = int(input())\nn1 = 0\nn2 = 0\nn3 = 0\nn4 = 0\nfor i in range(d):\n\t(a, b, c, v) = map(int, input().split())\n\tn1 = a * v\n\tn2 = a * (b - v - 1)\n\tn3 = b * (a - c - 1)\n\tn4 = b * c\n\tif n1 > n2:\n\t\ts1 = n1\n\telse:\n\t\ts1 = n2\n\tif n3 > n4:\n\t\ts2 = n3\n\telse:\n\t\ts2 = n4\n\tif s1 > s2:\n\t\tprint(s1)\n\telse:\n\t\tprint(s2)\n", "t = int(input())\n\ndef find(a, b, x, y):\n\tarest = a - (x + 1)\n\tm = max(x, arest)\n\tbrest = b - (y + 1)\n\tn = max(y, brest)\n\tres = max(n * a, m * b)\n\treturn res\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(find(a, b, x, y))\n", "T = int(input())\nwhile T > 0:\n\t(a, b, x, y) = map(int, input().split())\n\tans = 0\n\ttm = y * a\n\tif tm > ans:\n\t\tans = tm\n\ttm = x * b\n\tif tm > ans:\n\t\tans = tm\n\ttm = (b - y - 1) * a\n\tif tm > ans:\n\t\tans = tm\n\ttm = (a - x - 1) * b\n\tif tm > ans:\n\t\tans = tm\n\tprint(ans)\n\tT -= 1\n", "n = input('')\nfinal_output = []\nfor i in range(int(n)):\n\tthe_string = input('')\n\t(a, b, x, y) = the_string.split()\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\tmax_width = a\n\tmax_height = b\n\tif x > a - x - 1:\n\t\tmax_width = x\n\telse:\n\t\tmax_width = a - x - 1\n\tif y > b - y - 1:\n\t\tmax_height = y\n\telse:\n\t\tmax_height = b - y - 1\n\ta1 = b * max_width\n\ta2 = a * max_height\n\toutput = max(a1, a2)\n\tfinal_output.append(output)\nfor x in final_output:\n\tprint(x)\n", "from typing import List\nimport collections\nimport bisect\nimport itertools\nimport functools\nfrom fractions import gcd\nimport heapq\nfrom math import ceil, sqrt, floor\nt = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tret = max(b * x, b * (a - x - 1), a * y, a * (b - y - 1))\n\tprint(ret)\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = [int(i) for i in input().split(' ')]\n\tif a - x > x:\n\t\tw = a - x - 1\n\telse:\n\t\tw = x\n\tif b - y > y:\n\t\tv = b - y - 1\n\telse:\n\t\tv = y\n\ts = max(w * b, v * a)\n\tprint(s)\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tle = max(x, a - x - 1)\n\tbe = max(y, b - y - 1)\n\tprint(max(le * b, be * a))\n", "for i in [0] * int(input()):\n\t(a, b, x, y) = map(int, input().split())\n\tu = x * b\n\td = (a - 1 - x) * b\n\tr = y * a\n\tl = (b - 1 - y) * a\n\tprint(max(u, d, r, l))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\ts = [a * y, a * (b - 1 - y), b * x, b * (a - 1 - x)]\n\tprint(max(s))\n", "def readData():\n\tnumOfCases = int(input().rstrip('\\n'))\n\trawLines = [input().rstrip('\\n').split(' ') for _ in range(numOfCases)]\n\ttestCases = [(int(a), int(b), int(x) + 1, int(y) + 1) for [a, b, x, y] in rawLines]\n\treturn testCases\ntestCases = readData()\nfor (a, b, x, y) in testCases:\n\tp1 = a * (b - y)\n\tp2 = (a - x) * b\n\tp3 = a * (y - 1)\n\tp4 = (x - 1) * b\n\tprint(max([p1, p2, p3, p4]))\n", "n = int(input())\nfor r in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tl = [x * b, (a - x - 1) * b, a * y, a * (b - y - 1)]\n\tprint(max(l))\n", "t = int(input())\nfor i in range(t):\n\ta = list(map(int, input().split()))\n\tprint(max(a[1] * a[2], a[1] * (a[0] - a[2] - 1), a[0] * a[3], a[0] * (a[1] - a[3] - 1)))\n", "def test():\n\t(a, b, x, y) = [int(i) for i in input().split(' ')]\n\trect1 = x * b\n\trect2 = y * a\n\trect3 = (b - (y + 1)) * a\n\trect4 = (a - (x + 1)) * b\n\tprint(max(rect1, rect2, rect3, rect4))\nnum_tests = int(input())\nfor i in range(num_tests):\n\ttest()\n", "for t in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tsd = (b - y - 1) * a\n\tsu = y * a\n\tsl = x * b\n\tsr = (a - x - 1) * b\n\tprint(max(sd, su, sl, sr))\n", "t = int(input())\nfor test_case in range(t):\n\t(a, b, x, y) = [int(x) for x in input().split()]\n\tres = 0\n\tleft = 0\n\tright = 0\n\tup = 0\n\tdown = 0\n\tif x > 0:\n\t\tleft = b * x\n\tif x < a - 1:\n\t\tright = b * (a - 1 - x)\n\tif y > 0:\n\t\tup = a * y\n\tif y < b:\n\t\tdown = a * (b - 1 - y)\n\tres = max(left, right, up, down)\n\tprint()\n\tprint(res)\n\tprint()\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tarea1 = x * b\n\tarea2 = (a - x - 1) * b\n\tarea3 = a * y\n\tarea4 = a * (b - y - 1)\n\tprint(max(area1, area2, area3, area4))\n", "for i in range(int(input())):\n\t(length, height, x, y) = map(int, input().split())\n\tprint(max(length * y, height * x, length * (height - y - 1), height * (length - x - 1)))\n", "def func(a, b, x, y):\n\tX1 = x\n\tX2 = a - x - 1\n\tY1 = y\n\tY2 = b - y - 1\n\tA1 = X1 * b\n\tA2 = Y1 * a\n\tA3 = b * X2\n\tA4 = a * Y2\n\tans = max(A1, A2, A3, A4)\n\tprint(ans)\nt = int(input())\nwhile t != 0:\n\tt -= 1\n\t[a, b, x, y] = [int(x) for x in input().split()]\n\tfunc(a, b, x, y)\n", "t = input()\nt = int(t)\nfor i in range(0, t):\n\tthe_string = input()\n\t(a, b, x, y) = the_string.split()\n\t(a, b, x, y) = (int(a), int(b), int(x), int(y))\n\ta1 = x * b\n\ta2 = y * a\n\ta3 = (b - y - 1) * a\n\ta4 = (a - x - 1) * b\n\tprint(max(a1, a2, a3, a4))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tx1 = a - x - 1\n\ty1 = b - y - 1\n\tans = max(a * max(y, y1), b * max(x, x1))\n\tprint(ans)\n", "from sys import exit\n\ndef iis():\n\treturn map(int, input().split())\n\ndef ii():\n\treturn int(input())\n\ndef liis():\n\treturn list(map(int, input().split()))\n\ndef getsize(a, b, x, y):\n\tans = 0\n\tans = max(ans, x * b)\n\tans = max(ans, (a - x - 1) * b)\n\tans = max(ans, a * y)\n\tans = max(ans, a * (b - y - 1))\n\treturn ans\nt = ii()\nfor _ in range(t):\n\t(a, b, x, y) = iis()\n\tans = getsize(a, b, x, y)\n\tprint(ans)\n", "try:\n\tfor _ in range(int(input())):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tx = x + 1\n\t\ty = y + 1\n\t\tm = (x - 1) * b\n\t\tn = (a - x) * b\n\t\tp = (y - 1) * a\n\t\tq = (b - y) * a\n\t\tprint(max(m, n, p, q))\nexcept:\n\tpass\n", "t = int(input())\nls = []\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tm = max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a)\n\tls.append(m)\nfor i in ls:\n\tprint(i)\n", "n = int(input())\nResult = []\nfor i in range(0, n):\n\th = None\n\tList = list(map(int, input().strip().split()))[0:4]\n\tScreen_y = List[0]\n\tScreen_x = List[1]\n\tDead_pixel_y = List[2]\n\tDead_pixel_x = List[3]\n\tleft_difference = Dead_pixel_y\n\th = left_difference\n\tright_difference = Screen_y - Dead_pixel_y - 1\n\tif right_difference > left_difference:\n\t\th = right_difference\n\tup_difference = Dead_pixel_x\n\th_ = up_difference\n\tdown_difference = Screen_x - Dead_pixel_x - 1\n\tif down_difference > up_difference:\n\t\th_ = down_difference\n\th1 = h * Screen_x\n\tHigh = h1\n\th2 = h_ * Screen_y\n\tif h2 > h1:\n\t\tHigh = h2\n\tResult.append(High)\nfor i in Result:\n\tprint(i)\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = input().split(' ')\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\tx += 1\n\ty += 1\n\taa = a * (y - 1)\n\tbb = a * abs(b - y)\n\tcc = b * (x - 1)\n\tdd = b * abs(a - x)\n\tans = max(aa, bb)\n\tans = max(ans, cc)\n\tans = max(ans, dd)\n\tprint(ans)\n", "s = []\nt = int(input())\nfor jjjh in range(0, t):\n\tx = input()\n\txx = x.split()\n\ta = int(xx[0])\n\tb = int(xx[1])\n\tx = int(xx[2]) + 1\n\ty = int(xx[3]) + 1\n\tr = []\n\tif a == 1 and b != 1:\n\t\tr.append(y - 1)\n\t\tr.append(b - y)\n\t\ts.append(max(r))\n\telif b == 1 and a != 1:\n\t\tr.append(x - 1)\n\t\tr.append(a - x)\n\t\ts.append(max(r))\n\telse:\n\t\tif x > a / 2:\n\t\t\tf = x - 1\n\t\telse:\n\t\t\tf = a - x\n\t\tif y > b / 2:\n\t\t\tz = y - 1\n\t\telse:\n\t\t\tz = b - y\n\t\tr.append(f * b)\n\t\tr.append(z * a)\n\t\ts.append(max(r))\nfor i in s:\n\tprint(i)\n", "def get_res():\n\t(a, b, x, y) = [int(x) for x in input().split(' ')]\n\treturn max([(a - x - 1) * b, (b - y - 1) * a, x * b, y * a])\ni = int(input())\nfor j in range(i):\n\tprint(get_res())\n", "t = int(input())\nwhile t:\n\t(a, b, x, y) = map(int, input().split())\n\tleft = x * b\n\tright = (a - 1 - x) * b\n\tup = a * y\n\tdown = (b - 1 - y) * a\n\tprint(max(max(left, right), max(up, down)))\n\tt -= 1\n", "testcases = int(input())\nfor j in range(testcases):\n\tvalues = list(map(int, input().split()))\n\ta = values[0]\n\tb = values[1]\n\tx = values[2]\n\ty = values[3]\n\tarea1 = 0\n\tarea2 = 0\n\tif x < a - x:\n\t\tarea1 = (a - x - 1) * b\n\telif x >= a - x:\n\t\tarea1 = x * b\n\tif y < b - y:\n\t\tarea2 = (b - y - 1) * a\n\telif y >= b - y:\n\t\tarea2 = y * a\n\tprint(max(area1, area2))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tt1 = max(x, a - 1 - x)\n\tt2 = max(y, b - 1 - y)\n\tt3 = t1 * b\n\tt4 = t2 * a\n\tt5 = max(t3, t4)\n\tprint(t5)\n", "t = int(input())\nr = ''\nfor i in range(t):\n\t(a, b, x, y) = input().split()\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\ts1 = x * b\n\ts2 = y * a\n\ts3 = (a - x - 1) * b\n\ts4 = (b - y - 1) * a\n\ts = max(s1, s2, s3, s4)\n\tr += str(s) + '\\n'\nprint(r)\n", "t = int(input())\ntest_cases = [input() for i in range(t)]\n\ndef solve(test_case):\n\t(x, y, a, b) = map(int, test_case.split())\n\tprint(max(x * max(b, y - b - 1), y * max(a, x - a - 1)))\nfor test_case in test_cases:\n\tsolve(test_case)\n", "testCases = int(input())\nfor t in range(testCases):\n\t(a, b, x, y) = map(int, input().rstrip().split())\n\tareaCal = dict()\n\tareaCal.update(leftArea=b * x)\n\tareaCal.update(rightArea=b * (a - (x + 1)))\n\tareaCal.update(upArea=a * y)\n\tareaCal.update(downArea=a * (b - (y + 1)))\n\tmax_area = 0\n\tfor value in areaCal.values():\n\t\tif value > max_area:\n\t\t\tmax_area = value\n\tprint(max_area)\n", "_ = int(input())\nfor __ in range(_):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tres = 0\n\tres = max(res, (a - x - 1) * b)\n\tres = max(res, a * (b - y - 1))\n\tres = max(res, x * b)\n\tres = max(res, a * y)\n\tprint(res)\n", "n = int(input())\nl = []\nfor i in range(n):\n\t(x, y, x1, y1) = map(int, input().split())\n\ta = x1 * y\n\tb = x * y1\n\tc = x * (y - y1 - 1)\n\td = (x - x1 - 1) * y\n\tl.append(max(a, b, c, d))\nfor i in l:\n\tprint(i)\n", "from math import *\nfor asd in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tc1 = x * b\n\tc2 = a * y\n\tc3 = b * (a - x - 1)\n\tc4 = a * (b - y - 1)\n\tprint(max(c1, c2, c3, c4))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tbottom = a * (b - y - 1)\n\ttop = a * y\n\tright = b * (a - x - 1)\n\tleft = b * x\n\tprint(max(top, bottom, left, right))\n", "import math\nq = int(input())\nfor _ in range(q):\n\t(a, b, x, y) = map(int, input().split())\n\tans = max(a * y, b * x)\n\tans = max(ans, (b - y - 1) * a)\n\tans = max(ans, (a - x - 1) * b)\n\tprint(ans)\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\t(res1, res2, res3, res4) = (-1, -1, -1, -1)\n\tif x - 1 >= 0:\n\t\tres1 = x * b\n\tif x + 1 < a:\n\t\tres2 = (a - x - 1) * b\n\tif y - 1 >= 0:\n\t\tres3 = y * a\n\tif y + 1 < b:\n\t\tres4 = (b - y - 1) * a\n\tprint(max(res1, res2, res3, res4))\n", "t = int(input())\nfor i in range(0, t):\n\t(a, b, x, y) = map(int, input().split())\n\ta1 = 0\n\ta2 = 0\n\ta3 = 0\n\ta4 = 0\n\tif x - 1 >= 0:\n\t\ta1 = x * b\n\tif x + 1 < a:\n\t\ta2 = (a - x - 1) * b\n\tif y - 1 >= 0:\n\t\ta3 = y * a\n\tif y + 1 < b:\n\t\ta4 = (b - y - 1) * a\n\ts = max(a1, a2, a3, a4)\n\tprint(s)\n", "for i in range(int(input())):\n\tx = [int(x) for x in input().split()]\n\tprint(max(max(x[2], x[0] - 1 - x[2]) * x[1], max(x[3], x[1] - 1 - x[3]) * x[0]))\n", "import sys, atexit, io\nfrom collections import defaultdict, Counter\n_INPUT_LINES = sys.stdin.read().splitlines()\ninput = iter(_INPUT_LINES).__next__\n_OUTPUT_BUFFER = io.StringIO()\nsys.stdout = _OUTPUT_BUFFER\n\n@atexit.register\ndef write():\n\tsys.__stdout__.write(_OUTPUT_BUFFER.getvalue())\n\ndef main():\n\tfor _ in range(int(input())):\n\t\t(a, b, x, y) = [int(s) for s in input().split()]\n\t\tprint(max([x * b, y * a, (a - x - 1) * b, a * (b - y - 1)]))\nmain()\n", "def max_area(a, b, x, y):\n\tarea_1 = 0\n\tarea_2 = 0\n\tarea_3 = 0\n\tarea_4 = 0\n\tif x < a - x:\n\t\ta1 = a - x - 1\n\t\tb1 = b\n\t\tarea_1 = a1 * b1\n\telse:\n\t\ta2 = x\n\t\tb2 = b\n\t\tarea_2 = a2 * b2\n\tif y < b - y:\n\t\ta3 = a\n\t\tb3 = b - y - 1\n\t\tarea_3 = a3 * b3\n\telse:\n\t\ta4 = a\n\t\tb4 = y\n\t\tarea_4 = a4 * b4\n\treturn max(area_1, area_2, area_3, area_4)\nn = int(input())\ndata = []\nfor i in range(n):\n\tdata.append(list(map(int, input().split())))\nfor pack in data:\n\t(a, b, x, y) = pack\n\tprint(max_area(a, b, x, y))\n", "t = int(input())\nabxy = []\nfor _ in range(t):\n\tabxy.append(tuple((int(x) for x in input().split())))\nfor ab in abxy:\n\tded = (ab[2], ab[3])\n\tres = (ab[0], ab[1])\n\tx = (res[0] - ded[0], ded[0])\n\ty = (res[1] - ded[1], ded[1])\n\tprint(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]))\n", "for i in range(int(input())):\n\t(a, b, c, d) = map(int, input().split())\n\te = a - c - 1\n\tf = b - d - 1\n\tl = [c * b, d * a, e * b, f * a]\n\tl.sort()\n\tif c == 0 and d == 0 and (b - 1 == 0):\n\t\tprint((a - 1) * b)\n\t\tcontinue\n\tif c == 0 and d == 0 and (a - 1 == 0):\n\t\tprint((b - 1) * a)\n\t\tcontinue\n\tprint(l[3])\n", "for i in range(int(input())):\n\tq = []\n\t(a, b, x, y) = [int(z) for z in input().split()]\n\tif b - y - 1 > 0:\n\t\tq.append((b - y - 1) * a)\n\tif y > 0:\n\t\tq.append(y * a)\n\tif a - x - 1 > 0:\n\t\tq.append((a - x - 1) * b)\n\tif x > 0:\n\t\tq.append(x * b)\n\tprint(max(q))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = [int(__) for __ in input().split()]\n\tprint(max([x * b, (a - 1 - x) * b, a * y, a * (b - 1 - y)]))\n", "t_cases = int(input().strip())\ncount = 0\nwhile count < t_cases:\n\ttemp = list(map(int, input().strip().split(' ')))\n\tmax_x = temp[0]\n\tmax_y = temp[1]\n\tdead_x = temp[2]\n\tdead_y = temp[3]\n\tx_limit = max(abs(dead_x), abs(max_x - dead_x - 1))\n\ty_limit = max(abs(dead_y), abs(max_y - dead_y - 1))\n\tmax_area = max(max_x * y_limit, x_limit * max_y)\n\tprint(max_area)\n\tcount += 1\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tq = a * (b - y - 1)\n\tw = a * y\n\te = (a - x - 1) * b\n\tr = b * x\n\tprint(max(q, w, e, r))\n", "from __future__ import division, print_function\nimport os, sys\nfrom io import BytesIO, IOBase\nif sys.version_info[0] < 3:\n\tfrom __builtin__ import xrange as range\n\tfrom future_builtins import ascii, filter, hex, map, oct, zip\n\ndef ii():\n\treturn int(input())\n\ndef si():\n\treturn input()\n\ndef mi():\n\treturn map(int, input().strip().split(' '))\n\ndef msi():\n\treturn map(str, input().strip().split(' '))\n\ndef li():\n\treturn list(mi())\n\ndef dmain():\n\tsys.setrecursionlimit(1000000)\n\tthreading.stack_size(1024000)\n\tthread = threading.Thread(target=main)\n\tthread.start()\nimport sys\ninput = sys.stdin.readline\nscanner = lambda : int(input())\nstring = lambda : input().rstrip()\nget_list = lambda : list(read())\nread = lambda : map(int, input().split())\nget_float = lambda : map(float, input().split())\n\ndef ceil(x):\n\tif x != int(x):\n\t\tx = int(x) + 1\n\treturn x\n\ndef factorial(x, m):\n\tval = 1\n\twhile x > 0:\n\t\tval = val * x % m\n\t\tx -= 1\n\treturn val\n\ndef fact(x):\n\tval = 1\n\twhile x > 0:\n\t\tval *= x\n\t\tx -= 1\n\treturn val\n\ndef swaparr(arr, a, b):\n\ttemp = arr[a]\n\tarr[a] = arr[b]\n\tarr[b] = temp\n\ndef gcd(a, b):\n\tif b == 0:\n\t\treturn a\n\treturn gcd(b, a % b)\n\ndef lcm(a, b):\n\treturn a * b // math.gcd(a, b)\n\ndef is_integer(n):\n\treturn math.ceil(n) == math.floor(n)\n\ndef nCr(n, k):\n\tif k > n:\n\t\treturn 0\n\tif k > n - k:\n\t\tk = n - k\n\tres = 1\n\tfor i in range(k):\n\t\tres = res * (n - i)\n\t\tres = res / (i + 1)\n\treturn int(res) % MOD\n\ndef comb(n, x):\n\t(a, b) = (1, 1)\n\tfor i in range(1, x + 1):\n\t\ta *= n + 1 - i\n\t\tb *= i\n\treturn a // b % MOD\n\ndef primefs(n):\n\tprimes = {}\n\twhile n % 2 == 0 and n > 0:\n\t\tprimes[2] = primes.get(2, 0) + 1\n\t\tn = n // 2\n\tfor i in range(3, int(n ** 0.5) + 2, 2):\n\t\twhile n % i == 0 and n > 0:\n\t\t\tprimes[i] = primes.get(i, 0) + 1\n\t\t\tn = n // i\n\tif n > 2:\n\t\tprimes[n] = primes.get(n, 0) + 1\n\treturn primes\n\ndef power(x, y, p):\n\tif y == 0:\n\t\treturn 1\n\tres = 1\n\tx = x % p\n\tif x == 0:\n\t\treturn 0\n\twhile y > 0:\n\t\tif y & 1 == 1:\n\t\t\tres = res * x % p\n\t\ty = y >> 1\n\t\tx = x * x % p\n\treturn res\n\ndef swap(a, b):\n\ttemp = a\n\ta = b\n\tb = temp\n\treturn (a, b)\n\ndef find(x, link):\n\tp = x\n\twhile p != link[p]:\n\t\tp = link[p]\n\twhile x != p:\n\t\tnex = link[x]\n\t\tlink[x] = p\n\t\tx = nex\n\treturn p\n\ndef union(x, y, link, size):\n\tx = find(x, link)\n\ty = find(y, link)\n\tif size[x] < size[y]:\n\t\t(x, y) = swap(x, y)\n\tif x != y:\n\t\tsize[x] += size[y]\n\t\tlink[y] = x\n\ndef sieve(n):\n\tprime = [True for i in range(n + 1)]\n\t(prime[0], prime[1]) = (False, False)\n\tp = 2\n\twhile p * p <= n:\n\t\tif prime[p] == True:\n\t\t\tfor i in range(p * p, n + 1, p):\n\t\t\t\tprime[i] = False\n\t\tp += 1\n\treturn prime\n\ndef phi(n):\n\tresult = n\n\tp = 2\n\twhile p * p <= n:\n\t\tif n % p == 0:\n\t\t\twhile n % p == 0:\n\t\t\t\tn = n // p\n\t\t\tresult = result * (1.0 - 1.0 / float(p))\n\t\tp = p + 1\n\tif n > 1:\n\t\tresult = result * (1.0 - 1.0 / float(n))\n\treturn int(result)\n\ndef is_prime(n):\n\tif n == 0:\n\t\treturn False\n\tif n == 1:\n\t\treturn True\n\tfor i in range(2, int(n ** (1 / 2)) + 1):\n\t\tif not n % i:\n\t\t\treturn False\n\treturn True\n\ndef next_prime(n, primes):\n\twhile primes[n] != True:\n\t\tn += 1\n\treturn n\nMAXN = int(100000.0 + 5)\n\ndef spf_sieve():\n\tspf[1] = 1\n\tfor i in range(2, MAXN):\n\t\tspf[i] = i\n\tfor i in range(4, MAXN, 2):\n\t\tspf[i] = 2\n\tfor i in range(3, ceil(MAXN ** 0.5), 2):\n\t\tif spf[i] == i:\n\t\t\tfor j in range(i * i, MAXN, i):\n\t\t\t\tif spf[j] == j:\n\t\t\t\t\tspf[j] = i\nspf = [0 for i in range(MAXN)]\n\ndef factoriazation(x):\n\tres = []\n\tfor i in range(2, int(x ** 0.5) + 1):\n\t\twhile x % i == 0:\n\t\t\tres.append(i)\n\t\t\tx //= i\n\tif x != 1:\n\t\tres.append(x)\n\treturn res\n\ndef factors(n):\n\tres = []\n\tfor i in range(1, int(n ** 0.5) + 1):\n\t\tif n % i == 0:\n\t\t\tres.append(i)\n\t\t\tres.append(n // i)\n\treturn list(set(res))\n\ndef int_array():\n\treturn list(map(int, input().strip().split()))\n\ndef float_array():\n\treturn list(map(float, input().strip().split()))\n\ndef str_array():\n\treturn input().strip().split()\n\ndef binary_search(low, high, w, h, n):\n\twhile low < high:\n\t\tmid = low + (high - low) // 2\n\t\tif check(mid, w, h, n):\n\t\t\tlow = mid + 1\n\t\telse:\n\t\t\thigh = mid\n\treturn low\n\ndef check(moves, n):\n\tval = (moves + 1) // 2\n\trem = moves - val\n\tsol = (val + 1) * (rem + 1)\n\treturn sol < n\n\ndef sortSecond(val):\n\treturn val[1]\nMOD = int(1000000000.0) + 7\nCMOD = 998244353\nINF = float('inf')\nNINF = -float('inf')\nsmall = 'abcdefghijklmnopqrstuvwxyz'\nlarge = small.upper()\nfrom itertools import permutations\nimport math\nimport bisect as bis\nimport random\nimport sys\nimport collections as collect\nimport functools as fnt\nfrom decimal import Decimal\n\ndef interact(x, y):\n\tprint('?', x + 1, y + 1)\n\tspace = input()\n\tsys.stdout.flush()\n\treturn int(input())\n\ndef solve():\n\t(a, b, x, y) = read()\n\tcase1 = x * b\n\tcase2 = a * y\n\tcase3 = (a - x - 1) * b\n\tcase4 = a * (b - y - 1)\n\tprint(max(max(case1, case2), max(case3, case4)))\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n\ndef print(*args, **kwargs):\n\t(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))\n\tat_start = True\n\tfor x in args:\n\t\tif not at_start:\n\t\t\tfile.write(sep)\n\t\tfile.write(str(x))\n\t\tat_start = False\n\tfile.write(kwargs.pop('end', '\\n'))\n\tif kwargs.pop('flush', False):\n\t\tfile.flush()\nif sys.version_info[0] < 3:\n\t(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))\nelse:\n\t(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nt = scanner()\nfor i in range(t):\n\tsolve()\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = (int(i) for i in input().split())\n\tres = max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a)\n\tprint(res)\n", "no = int(input())\nres = []\nfor i in range(no):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\tleft = (x - 1) * b\n\tright = (a - x) * b\n\tabove = a * (y - 1)\n\tbelow = (b - y) * a\n\tmm = max(left, right, above, below)\n\tres.append(mm)\nfor i in res:\n\tprint(i)\n", "import math\ntestCases = int(input())\nfor _ in range(testCases):\n\t(a, b, x, y) = map(int, input().split())\n\tareas = []\n\tareas.append((b - (y + 1)) * a)\n\tareas.append(b * (a - (x + 1)))\n\tareas.append(a * y)\n\tareas.append(b * x)\n\tprint(max(areas))\n", "def revolt(a, b, x, y):\n\tx = x + 1\n\ty = y + 1\n\tval = max(b * (x - 1), b * (a - x), a * (y - 1), a * (b - y))\n\tval1 = val ** 0.5\n\tif isinstance(val1, int):\n\t\treturn val1 * (val1 - 1)\n\treturn val\nfor _ in range(int(input())):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tprint(revolt(a, b, x, y))\n", "k = int(input())\nfor i in range(k):\n\t(a, b, c, d) = map(int, input().split())\n\tmax1 = 0\n\tmax2 = 0\n\tnd1 = min(c - 0, a - c)\n\tnd2 = min(d - 0, b - d)\n\tif nd1 == a - c:\n\t\tgun1 = a - nd1\n\t\tmax1 = gun1 * b\n\telse:\n\t\tgun1 = a - (c + 1)\n\t\tmax1 = gun1 * b\n\tif nd2 == b - d:\n\t\tgun2 = b - nd2\n\t\tmax2 = gun2 * a\n\telse:\n\t\tgun2 = b - (d + 1)\n\t\tmax2 = gun2 * a\n\tmaxi = max(max1, max2)\n\tprint(maxi)\n", "l = []\nfor i in range(int(input())):\n\t(a, b, c, d) = map(int, input().split())\n\t(c1, d1) = (c + 1, d + 1)\n\tl.append(max((a - c1) * b, (b - d1) * a, c * b, d * a))\nfor i in l:\n\tprint(i)\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tp = max(x, a - x - 1)\n\tq = max(y, b - y - 1)\n\tprint(max(p * b, q * a))\n", "n = int(input())\nfor i in range(n):\n\tl = [int(k) for k in input().split()]\n\txl = l[0]\n\tyl = l[1]\n\txd = l[2] + 1\n\tyd = l[3] + 1\n\tans = max((xl - xd) * yl, xl * (yl - yd), (xd - 1) * yl, xl * (yd - 1))\n\tprint(ans)\n", "for run in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tleft = x * b\n\tright = (a - 1 - x) * b\n\ttop = a * y\n\tdown = a * (b - 1 - y)\n\tprint(max(left, right, top, down))\n", "t = int(input())\nwhile t > 0:\n\t(a, b, x, y) = input().split()\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\tm = y * a\n\tif m < (b - y - 1) * a:\n\t\tm = (b - y - 1) * a\n\tif m < x * b:\n\t\tm = x * b\n\tif m < (a - x - 1) * b:\n\t\tm = (a - x - 1) * b\n\tprint(m)\n\tt -= 1\n", "x = int(input())\nfor _ in range(x):\n\t(a, b, c, d) = map(int, input().split())\n\tprint(max(max(a - c - 1, c) * b, max(b - d - 1, d) * a))\n", "from math import *\n\ndef binarySearch(arr, x, i):\n\tl = i\n\tr = len(arr) - 1\n\twhile l <= r:\n\t\tmid = (l + r) // 2\n\t\tif arr[mid] == x:\n\t\t\treturn mid\n\t\telif arr[mid] < x:\n\t\t\tl = mid + 1\n\t\telse:\n\t\t\tr = mid - 1\n\treturn -1\n\ndef js(arr, x):\n\tl = 0\n\tr = len(arr) - 1\n\tans = -1\n\twhile l <= r:\n\t\tm = (l + r) // 2\n\t\tif arr[m] <= x:\n\t\t\tans = m\n\t\t\tl = m + 1\n\t\telse:\n\t\t\tr = m - 1\n\treturn ans\n\ndef jg(arr, x):\n\tl = 0\n\tr = len(arr) - 1\n\tans = -1\n\twhile l <= r:\n\t\tm = (l + r) // 2\n\t\tif arr[m] >= x:\n\t\t\tans = m\n\t\t\tr = m - 1\n\t\telse:\n\t\t\tl = m + 1\n\treturn ans\n\ndef ceil(a, b):\n\tif a % b == 0:\n\t\treturn int(a / b)\n\telse:\n\t\treturn a // b + 1\nfor i in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tans = 0\n\tans = max(ans, a * (b - y - 1))\n\tans = max(ans, b * (a - x - 1))\n\tans = max(ans, a * y)\n\tans = max(ans, x * b)\n\tprint(ans)\n", "T = int(input())\nfor ti in range(T):\n\t(a, b, x, y) = map(int, input().split())\n\tsol = max([x * b, (a - (x + 1)) * b, y * a, (b - (y + 1)) * a])\n\tprint(sol)\n", "for ttt in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\tp = b * (x - 1)\n\tq = b * (a - x)\n\tr = a * (y - 1)\n\ts = a * (b - y)\n\tprint(max(p, q, r, s))\n", "t = int(input())\nfor _ in range(t):\n\t(x, y, a, b) = map(int, input().split())\n\t(left, right, up, down) = (0, 0, 0, 0)\n\ta += 1\n\tb += 1\n\tif a - 1 > -1:\n\t\tleft = a - 1\n\tif a + 1 <= x:\n\t\tright = x - a\n\tif b - 1 > -1:\n\t\tup = b - 1\n\tif b + 1 <= y:\n\t\tdown = y - b\n\tleft *= y\n\tright *= y\n\tup *= x\n\tdown *= x\n\tprint(max(left, right, up, down))\n", "t = int(input())\nnew_l = list()\nfor i in range(t):\n\tstring = list(input().split(' '))\n\ts1 = (int(string[0]) - int(string[2]) - 1) * int(string[1])\n\ts2 = (int(string[0]) - (int(string[0]) - int(string[2]) - 1) - 1) * int(string[1])\n\ts3 = int(string[0]) * (int(string[1]) - int(string[3]) - 1)\n\ts4 = int(string[0]) * (int(string[1]) - (int(string[1]) - int(string[3]) - 1) - 1)\n\tnew_l.append(max(s1, s2, s3, s4))\nfor i in new_l:\n\tprint(i)\n", "t = int(input())\nres = []\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split(' '))\n\ts1 = x * b\n\ts2 = (a - x - 1) * b\n\ts3 = y * a\n\ts4 = (b - y - 1) * a\n\tres.append(max(s1, s2, s3, s4))\nfor i in range(len(res)):\n\tprint(res[i])\n", "import sys\n\ndef main():\n\tn = int(input())\n\tfor _ in range(n):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\txp = max(a - x - 1, x)\n\t\typ = max(b - y - 1, y)\n\t\tprint(max(xp * b, yp * a))\nmain()\n", "from math import ceil\nn = int(input())\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(b * max(x, a - x - 1), a * max(y, b - y - 1)))\n", "import sys\nt = int(sys.stdin.readline())\nfor _ in range(t):\n\tline = sys.stdin.readline().split()\n\t(a, b) = (int(line[0]), int(line[1]))\n\t(x, y) = (int(line[2]), int(line[3]))\n\topt1 = max(x, a - x - 1) * b\n\topt2 = a * max(y, b - y - 1)\n\tprint(max(opt1, opt2))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\tone = max(a - x, x - 1) * b\n\ttwo = max(b - y, y - 1) * a\n\tprint(max(one, two))\n", "import sys\ninput = lambda : sys.stdin.readline().rstrip()\nfor _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max((a - x - 1) * b, (b - y - 1) * a, x * b, y * a))\n", "N = int(input())\nfor _ in range(N):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\trect1 = (a - x - 1) * b\n\trect2 = x * b\n\trect3 = (b - y - 1) * a\n\trect4 = y * a\n\tprint(max(rect1, rect2, rect3, rect4))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, c, d) = map(int, input().split())\n\tans1 = max(c, a - c - 1) * b\n\tans2 = max(d, b - d - 1) * a\n\tprint(max(ans1, ans2))\n", "import itertools\nimport math\nimport sys\nimport heapq\nfrom collections import Counter\nfrom collections import deque\nfrom fractions import gcd\nfrom functools import reduce\nsys.setrecursionlimit(4100000)\nINF = 1 << 60\nMOD = 10 ** 9 + 7\nt = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tans = [b * max(x, a - x - 1), a * max(y, b - y - 1)]\n\tprint(max(ans))\n", "t = int(input())\nfor case in range(t):\n\t(a, b, x, y) = [int(s) for s in input().split(' ')]\n\tprint(max(x * b, y * a, (a - 1 - x) * b, (b - 1 - y) * a))\n", "for _ in range(int(input())):\n\tl = list(map(int, input().split()))\n\tx = max(abs(l[1] - l[3] - 1), l[3])\n\tans1 = x * l[0]\n\ty = max(abs(l[0] - l[2] - 1), l[2])\n\tans2 = y * l[1]\n\tprint(max(ans1, ans2))\n", "def solution(a, b, x, y):\n\tl = x * b\n\tr = (a - 1 - x) * b\n\td = y * a\n\tu = (b - 1 - y) * a\n\tprint(max(l, r, d, u))\nt = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tsolution(a, b, x, y)\n", "def solve():\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(max(x, a - x - 1) * b, max(y, b - y - 1) * a))\nt = int(input())\nfor _ in range(t):\n\tsolve()\n", "t = int(input())\nfor i in range(t):\n\tl = list(map(int, input().split()))\n\tlength = max(l[0] - l[2] - 1, l[2])\n\tbreadth = max(l[1] - l[3] - 1, l[3])\n\tprint(max(length * l[1], breadth * l[0]))\n", "def tv(l):\n\t(a, b, x, y) = (l[0], l[1], l[2], l[3])\n\tprint(max(x * b, (a - x - 1) * b, y * a, (b - y - 1) * a))\nfor t in range(int(input())):\n\tl = list(map(int, input().split()))\n\ttv(l)\n", "a = int(input())\nl = []\nfor i in range(a):\n\tbuf = list(map(int, input().split()))\n\tl.append(buf)\nfor i in range(a):\n\tx = l[i][0] - l[i][2] - 1\n\ty = l[i][1] - l[i][3] - 1\n\tx1 = l[i][0] - x - 1\n\ty1 = l[i][1] - y - 1\n\tif y >= y1:\n\t\ta = y\n\telse:\n\t\ta = y1\n\tif x >= x1:\n\t\tb = x\n\telse:\n\t\tb = x1\n\tif a * l[i][0] > b * l[i][1]:\n\t\tprint(l[i][0] * a)\n\telse:\n\t\tprint(l[i][1] * b)\n", "cases = int(input())\nwhile cases:\n\tcases -= 1\n\t(a, b, x, y) = map(int, input().split())\n\tx = min(x, a - x - 1)\n\ty = min(y, b - y - 1)\n\tprint(max((b - y - 1) * a, (a - x - 1) * b))\n", "N = int(input())\nfor _ in range(N):\n\t(a, b, x, y) = map(int, input().split())\n\tif 2 * x < a:\n\t\tnew_a = a - x - 1\n\telse:\n\t\tnew_a = x\n\tif 2 * y < b:\n\t\tnew_b = b - y - 1\n\telse:\n\t\tnew_b = y\n\tprint(max(new_a * b, a * new_b))\n", "def main():\n\tt = int(input())\n\tfor __ in range(t):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tprint(max(max(x * b, (a - 1 - x) * b), max(y * a, (b - 1 - y) * a)))\nmain()\n", "for t in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tl = [(a - x - 1) * b, (x - 0) * b, (b - y - 1) * a, (y - 0) * a]\n\tprint(max(l))\n", "from math import *\nfrom collections import *\nt = int(input())\nfor y in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tl = max(x, a - x - 1)\n\tw = max(y, b - y - 1)\n\tprint(max(l * b, a * w))\n", "t = int(input().strip())\nfor i in range(0, t):\n\t(a, b, x, y) = map(int, input().strip().split())\n\tarea = max(b * x, a * y, (a - x - 1) * b, (b - y - 1) * a)\n\tprint(area)\n", "from sys import stdin\nr = stdin.readline\n\ndef main():\n\tcases = int(r())\n\tfor case in range(cases):\n\t\t(a, b, i, j) = map(int, r().strip().split())\n\t\tprint(max((b - j - 1) * a, j * a, b * i, (a - i - 1) * b))\nmain()\n", "te = int(input())\nwhile te > 0:\n\tte -= 1\n\t(A, B, x, y) = list(map(int, input().split()))\n\tans = max(A * y, max(x * B, max((A - 1 - x) * B, A * (B - 1 - y))))\n\tprint(ans)\n", "T = int(input())\nins = []\nouts = []\nfor i in range(T):\n\t(a, b, x, y) = [int(x) for x in input().split(' ')]\n\tp = a * y\n\tq = a * (b - y - 1)\n\tr = b * x\n\ts = b * (a - x - 1)\n\touts.append(max([p, q, r, s]))\nfor i in outs:\n\tprint(i)\n", "def main():\n\tfor _ in range(int(input())):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tprint(max(max(x, a - x - 1) * b, max(y, b - y - 1) * a))\nmain()\n", "n = int(input())\nfor _ in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\tw1 = (x - 1) * b\n\tw2 = (a - x) * b\n\tw3 = (y - 1) * a\n\tw4 = (b - y) * a\n\tprint(max(w1, w2, w3, w4))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\te = b * x\n\tf = a * y\n\tg = a * (b - y - 1)\n\th = b * (a - x - 1)\n\tprint(max(e, f, g, h))\n", "def dead_pixel(a, b, x, y):\n\tl1 = [x, a - (x + 1)]\n\tl2 = [y, b - (y + 1)]\n\tif 0 in l1:\n\t\tl1.remove(0)\n\tif 0 in l2:\n\t\tl2.remove(0)\n\tl3 = [a * max(l2), b * max(l1)]\n\tar = max(l3)\n\treturn ar\nt = int(input())\nfor _ in range(t):\n\tabxy = input().split()\n\ta = int(abxy[0])\n\tb = int(abxy[1])\n\tx = int(abxy[2])\n\ty = int(abxy[3])\n\tprint(dead_pixel(a, b, x, y))\n", "def res(a, b, x, y):\n\treturn max((a - 1 - x) * b, x * b, a * y, (b - 1 - y) * a)\nt = int(input())\nfor i in range(t):\n\t(a, b, x, y) = [int(x) for x in input().split()]\n\tprint(res(a, b, x, y))\n", "t = int(input())\nwhile t:\n\tt -= 1\n\t(a, b, x, y) = map(int, input().split())\n\ts = 0\n\tf = abs(a - x - 1) * b\n\tf1 = abs(x) * b\n\tf2 = abs(b - y - 1) * a\n\tf3 = abs(y) * a\n\tprint(max(f, f1, f2, f3))\n", "t = int(input())\nfor i in range(t):\n\tti = list(map(int, input().split()))\n\tout1 = (ti[0] - ti[2] - 1) * ti[1]\n\tout2 = (ti[1] - ti[3] - 1) * ti[0]\n\tout3 = ti[0] * ti[3]\n\tout4 = ti[1] * ti[2]\n\tprint(max(out1, out2, out3, out4))\n", "import math\nimport sys\nimport itertools\nimport fractions\nwtf = sys.stdin.read()\nwtf = wtf.strip().split('\\n')\nfor t in wtf[1:]:\n\t(a, b, x, y) = map(int, t.split())\n\tans = []\n\tif x - 1 >= 0:\n\t\tans.append(x * b)\n\tif x + 1 < a:\n\t\tans.append((a - x - 1) * b)\n\tif y - 1 >= 0:\n\t\tans.append(y * a)\n\tif y + 1 < b:\n\t\tans.append((b - y - 1) * a)\n\tprint(max(ans))\n", "import math\nimport sys\nInput = sys.stdin.readline\nmetalica = int(input())\nfor i in range(metalica):\n\t(a, b, c, d) = map(int, input().split())\n\tc += 1\n\td += 1\n\tone_text = (a - c) * b\n\ttwo_test = (c - 1) * b\n\tthree_test = (b - d) * a\n\tfour_test = (d - 1) * a\n\tprint(max(one_text, two_test, three_test, four_test))\n", "for i in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tn1 = x * b\n\tn2 = y * a\n\tn3 = (a - x - 1) * b\n\tn4 = (b - y - 1) * a\n\tprint(max(n1, n2, n3, n4))\n", "T = int(input())\nfor _ in range(T):\n\t(a, b, x, y) = map(int, input().split())\n\tres = max(max(x * b, (a - 1 - x) * b), max(a * y, a * (b - 1 - y)))\n\tprint(res)\n", "t = int(input())\nfor n in range(1, t + 1):\n\tlist = []\nfor n in range(1, t + 1):\n\t(a, b, x, y) = input().split()\n\tx = int(x)\n\ty = int(y)\n\ta = int(a)\n\tb = int(b)\n\tlist.append(max(x * b, (a - x - 1) * b, a * y, a * (b - y - 1)))\nfor n in list:\n\tprint(n)\n", "def main():\n\tfor _ in range(int(input())):\n\t\t(c, r, xc, yr) = map(int, input().split(' '))\n\t\tl = list()\n\t\tl.append(c * (r - (yr + 1)))\n\t\tl.append(c * yr)\n\t\tl.append(xc * r)\n\t\tl.append((c - (xc + 1)) * r)\n\t\tprint(max(l))\nmain()\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split(' '))\n\tz = max(abs(0 - y), abs(b - y - 1))\n\tzz = max(abs(0 - x), abs(a - x - 1))\n\tprint(max(z * a, zz * b))\n", "def solve():\n\t(a, b, x, y) = map(int, input().split())\n\tbola = max(x, a - x - 1)\n\tbolsa = bola * b\n\tbolb = max(y, b - y - 1)\n\tbolsb = bolb * a\n\tbols = max(bolsa, bolsb)\n\tprint(bols)\nt = int(input())\nfor i in range(t):\n\tsolve()\n", "def main():\n\tfor t in range(int(input())):\n\t\t(a, b, x, y) = [int(j) for j in input().split()]\n\t\tarea = max((a - x - 1) * b, (b - y - 1) * a, 0, x * b, y * a)\n\t\tprint(area)\nmain()\n", "cases = int(input())\nresult = []\nfor i in range(cases):\n\t(c, r, x, y) = map(int, input().split())\n\tresult.append(max(x * r, (c - x - 1) * r, y * c, (r - y - 1) * c))\nfor i in result:\n\tprint(i)\n", "import sys\nn = int(input())\nR = lambda : map(int, input().split())\nfor i in range(n):\n\t(a, b, x, y) = R()\n\tprint(max(max(x, a - x - 1) * b, max(y, b - y - 1) * a))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = (int(x) for x in input().split(' '))\n\tx += 1\n\ty += 1\n\t(up, right) = (0, 0)\n\tright_x = a - x\n\tright_y = b\n\tup_y = b - y\n\tup_x = a\n\ts_right = right_x * right_y\n\ts_up = up_x * up_y\n\ts_left = a * b - s_right - b\n\ts_down = a * b - s_up - a\n\tprint(max(s_down, s_left, s_right, s_up))\n", "t = int(input())\nfor a in range(0, t):\n\tn = input()\n\tar = n.split(' ')\n\trow = int(ar[0])\n\tcol = int(ar[1])\n\tdr = int(ar[2]) + 1\n\tdc = int(ar[3]) + 1\n\thigh1 = max(row * (dc - 1), row * (col - dc))\n\thigh2 = max(col * (dr - 1), col * (row - dr))\n\tans = max(high1, high2)\n\tprint(ans)\n", "def R():\n\treturn map(int, input().split())\n\ndef I():\n\treturn int(input())\n\ndef S():\n\treturn str(input())\n\ndef L():\n\treturn list(R())\nfrom collections import Counter\nimport math\nimport sys\nfrom itertools import permutations\nimport bisect\nfor _ in range(I()):\n\t(a, b, x, y) = R()\n\tprint(max(max(y * a, (b - 1 - y) * a), max(x * b, (a - 1 - x) * b)))\n", "from collections import defaultdict, deque, Counter\nfrom sys import stdin, stdout\nfrom heapq import heappush, heappop\nimport math\nimport io\nimport os\nimport math\nimport bisect\n\ndef isPrime(x):\n\tfor i in range(2, x):\n\t\tif i * i > x:\n\t\t\tbreak\n\t\tif x % i == 0:\n\t\t\treturn False\n\treturn True\n\ndef ncr(n, r, p):\n\tnum = den = 1\n\tfor i in range(r):\n\t\tnum = num * (n - i) % p\n\t\tden = den * (i + 1) % p\n\treturn num * pow(den, p - 2, p) % p\n\ndef primeFactors(n):\n\tl = []\n\twhile n % 2 == 0:\n\t\tl.append(2)\n\t\tn = n / 2\n\tfor i in range(3, int(math.sqrt(n)) + 1, 2):\n\t\twhile n % i == 0:\n\t\t\tl.append(int(i))\n\t\t\tn = n / i\n\tif n > 2:\n\t\tl.append(n)\n\treturn list(set(l))\n\ndef power(x, y, p):\n\tres = 1\n\tx = x % p\n\tif x == 0:\n\t\treturn 0\n\twhile y > 0:\n\t\tif y & 1 == 1:\n\t\t\tres = res * x % p\n\t\ty = y >> 1\n\t\tx = x * x % p\n\treturn res\n\ndef sieve(n):\n\tprime = [True for i in range(n + 1)]\n\tp = 2\n\twhile p * p <= n:\n\t\tif prime[p] == True:\n\t\t\tfor i in range(p * p, n + 1, p):\n\t\t\t\tprime[i] = False\n\t\tp += 1\n\treturn prime\n\ndef digits(n):\n\tc = 0\n\twhile n > 0:\n\t\tn //= 10\n\t\tc += 1\n\treturn c\n\ndef ceil(n, x):\n\tif n % x == 0:\n\t\treturn n // x\n\treturn n // x + 1\n\ndef mapin():\n\treturn map(int, input().split())\ninput = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\nt = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = mapin()\n\tprint(max(b * max(x, a - x - 1), a * max(y, b - y - 1)))\n", "import sys\n\ndef solve(A, B, X, Y):\n\treturn max(X * B, (A - X - 1) * B, A * Y, A * (B - Y - 1))\ninput = sys.stdin.readline\nT = int(input())\nfor t in range(T):\n\t(A, B, X, Y) = map(int, input().split())\n\tans = solve(A, B, X, Y)\n\tprint(ans)\n", "def get_max_rectangle_area(a, b, x, y):\n\treturn max((a - x - 1) * b, x * b, (b - y - 1) * a, y * a)\n\ndef get_input():\n\treturn [int(x) for x in input().split()]\n\ndef main():\n\ttest_cases = int(input())\n\tfor i in range(test_cases):\n\t\ttest_case = get_input()\n\t\tprint(get_max_rectangle_area(test_case[0], test_case[1], test_case[2], test_case[3]))\nmain()\n", "x = int(input())\nfor i in range(x):\n\ty = str(input()).split(' ')\n\tz = [int(y[0]), int(y[1]), int(y[2]), int(y[3])]\n\tareaXinteiro = z[1] * max(z[0] - z[2] - 1, z[2])\n\tareaYinteiro = z[0] * max(z[1] - z[3] - 1, z[3])\n\tareaDeadpixelperdida = max(z[0] * z[3], z[1] * z[2])\n\tarea = max(areaXinteiro, areaYinteiro, areaDeadpixelperdida)\n\tprint(area)\n", "import os\nfrom io import BytesIO, IOBase\nimport sys\nfrom collections import defaultdict, deque, Counter\nfrom bisect import *\nfrom math import sqrt, pi, ceil\nimport math\nfrom itertools import permutations\nfrom copy import deepcopy\n\ndef main():\n\tfor t in range(int(input())):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tprint(max((a - x - 1) * b, (b - y - 1) * a, x * b, y * a))\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nmain()\n", "import sys\nimport math\nimport itertools\nimport functools\nimport collections\nimport operator\nimport fileinput\n\ndef ii():\n\treturn int(input())\n\ndef mi():\n\treturn map(int, input().split())\n\ndef li():\n\treturn list(map(int, input().split()))\n\ndef lcm(a, b):\n\treturn abs(a * b) // math.gcd(a, b)\n\ndef revn(n):\n\treturn str(n)[::-1]\n\ndef dd():\n\treturn collections.defaultdict(int)\n\ndef ddl():\n\treturn collections.defaultdict(list)\n\ndef sieve(n):\n\tif n < 2:\n\t\treturn list()\n\tprime = [True for _ in range(n + 1)]\n\tp = 3\n\twhile p * p <= n:\n\t\tif prime[p]:\n\t\t\tfor i in range(p * 2, n + 1, p):\n\t\t\t\tprime[i] = False\n\t\tp += 2\n\tr = [2]\n\tfor p in range(3, n + 1, 2):\n\t\tif prime[p]:\n\t\t\tr.append(p)\n\treturn r\n\ndef divs(n, start=2):\n\tr = []\n\tfor i in range(start, int(math.sqrt(n) + 1)):\n\t\tif n % i == 0:\n\t\t\tif n / i == i:\n\t\t\t\tr.append(i)\n\t\t\telse:\n\t\t\t\tr.extend([i, n // i])\n\treturn r\n\ndef divn(n, primes):\n\tdivs_number = 1\n\tfor i in primes:\n\t\tif n == 1:\n\t\t\treturn divs_number\n\t\tt = 1\n\t\twhile n % i == 0:\n\t\t\tt += 1\n\t\t\tn //= i\n\t\tdivs_number *= t\n\ndef prime(n):\n\tif n == 2:\n\t\treturn True\n\tif n % 2 == 0 or n <= 1:\n\t\treturn False\n\tsqr = int(math.sqrt(n)) + 1\n\tfor d in range(3, sqr, 2):\n\t\tif n % d == 0:\n\t\t\treturn False\n\treturn True\n\ndef convn(number, base):\n\tnewnumber = 0\n\twhile number > 0:\n\t\tnewnumber += number % base\n\t\tnumber //= base\n\treturn newnumber\n\ndef cdiv(n, k):\n\treturn n // k + (n % k != 0)\nfor _ in range(ii()):\n\t(a, b, x, y) = mi()\n\tprint(max(a * max(y, b - y - 1), b * max(x, a - x - 1)))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = [int(g) for g in input().split()]\n\tprint(max(y * a, x * b, (b - y - 1) * a, (a - x - 1) * b))\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\tarea1 = max(a - (x + 1), x) * b\n\tarea2 = a * max(b - (y + 1), y)\n\tprint(max(area1, area2))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tm = max([(x, b), (a - x - 1, b), (a, y), (a, b - y - 1)], key=lambda d: d[0] * d[1])\n\tprint(m[0] * m[1])\n", "for i in range(int(input())):\n\t(a, b, c, d) = map(int, input().split())\n\tf = (b - d - 1) * a\n\tg = d * a\n\th = (a - c - 1) * b\n\ti = c * b\n\tprint(max(f, g, h, i))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = [int(h) for h in input().strip().split(' ')]\n\tl1 = a * (b - y - 1)\n\tl2 = a * y\n\tl3 = b * (a - x - 1)\n\tl4 = b * x\n\tans = max(max(l1, l2), max(l3, l4))\n\tprint(ans)\n", "import sys\ninp = sys.stdin.readline\ninput = lambda : inp().strip()\n\ndef iin():\n\treturn int(input())\n\ndef lin():\n\treturn list(map(int, input().split()))\n\ndef main():\n\tT = iin()\n\twhile T:\n\t\tT -= 1\n\t\t(a, b, x, y) = lin()\n\t\tans = max(b * x, a * y, b * (a - x - 1), a * (b - y - 1))\n\t\tprint(ans)\nmain()\n", "t = int(input())\nfor i in range(t):\n\t(m, n, x, y) = map(int, input().strip().split(' '))\n\ta = max(x, m - (x + 1))\n\tb = max(y, n - (y + 1))\n\tif m == 1 or n == 1:\n\t\tprint(max(a, b))\n\telse:\n\t\tc1 = b * m\n\t\tc2 = a * n\n\t\tprint(max(c1, c2))\n", "for _ in range(int(input())):\n\tl = input().split(' ')\n\tfor i in range(0, 4):\n\t\tl[i] = int(l[i])\n\tx = (l[0] - 1 - l[2]) * l[1]\n\ty = (l[1] - 1 - l[3]) * l[0]\n\tz = l[3] * l[0]\n\ta = l[2] * l[1]\n\tprint(max(a, x, y, z))\n", "from sys import stdin, stderr\n\ndef rl():\n\treturn [int(w) for w in stdin.readline().split()]\n(t,) = rl()\nfor _ in range(t):\n\t(a, b, x, y) = rl()\n\tprint(max(x * b, y * a, (a - x - 1) * b, (b - y - 1) * a))\n", "import sys\nfrom collections import Counter\n\ndef input():\n\treturn sys.stdin.readline().strip()\n\ndef list2d(a, b, c):\n\treturn [[c] * b for i in range(a)]\n\ndef list3d(a, b, c, d):\n\treturn [[[d] * c for j in range(b)] for i in range(a)]\n\ndef list4d(a, b, c, d, e):\n\treturn [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\ndef ceil(x, y=1):\n\treturn int(-(-x // y))\n\ndef INT():\n\treturn int(input())\n\ndef MAP():\n\treturn map(int, input().split())\n\ndef LIST(N=None):\n\treturn list(MAP()) if N is None else [INT() for i in range(N)]\n\ndef Yes():\n\tprint('Yes')\n\ndef No():\n\tprint('No')\n\ndef YES():\n\tprint('YES')\n\ndef NO():\n\tprint('NO')\nINF = 10 ** 18\nMOD = 10 ** 9 + 7\nfor _ in range(INT()):\n\t(a, b, x, y) = MAP()\n\tmx = max((a - x - 1) * b, x * b, a * (b - y - 1), a * y)\n\tprint(mx)\n", "for i in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tc = max((a - x - 1) * b, a * (b - y - 1))\n\td = abs(max((a - (a - x)) * b, a * (b - (b - y))))\n\tprint(max(c, d))\n", "local = False\nif local:\n\tfile = open('A.txt', 'r')\n\ndef readInput():\n\tif local:\n\t\treturn file.readline()\n\telse:\n\t\treturn input()\n\ndef solve(a, b, x, y):\n\tx += 1\n\ty += 1\n\treturn max(b * (a - x), b * (x - 1), a * (b - y), a * (y - 1))\nt = int(readInput())\nfor i in range(t):\n\tabxy = readInput().split()\n\t(a, b, x, y) = (int(abxy[0]), int(abxy[1]), int(abxy[2]), int(abxy[3]))\n\tprint(solve(a, b, x, y))\n", "for _ in range(int(input())):\n\t(x, y, n, m) = map(int, input().split())\n\tn += 1\n\tm += 1\n\tprint(max(x * (m - 1), x * (y - m), y * (n - 1), y * (x - n)))\n", "t = int(input())\nfor i in range(t):\n\tpix = [int(c) for c in input().split()]\n\tprint(max((pix[0] - pix[2] - 1) * pix[1], (pix[1] - pix[3] - 1) * pix[0], pix[0] * pix[3], pix[1] * pix[2]))\n", "for t in range(int(input())):\n\t(a, b, x, y) = [int(elem) for elem in input().split(' ')]\n\tprint(max(y * a, (b - y - 1) * a, b * (a - x - 1), b * x))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tk = b * x\n\th = a * y\n\tn = (a - x - 1) * b\n\tm = (b - y - 1) * a\n\tprint(max(k, h, n, m))\n", "import sys\npin = sys.stdin.readline\npout = sys.stdout.write\nran = range\nm = int(pin())\nmape = map\nfor i in ran(m):\n\t(a, b, x, y) = mape(int, pin().split())\n\tprint(max(y * a, (b - (y + 1)) * a, x * b, (a - (x + 1)) * b))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\trec1 = (a - x) * b\n\trec2 = (x - 1) * b\n\trec3 = (y - 1) * a\n\trec4 = a * (b - y)\n\tprint(max(rec1, rec2, rec3, rec4))\n", "from __future__ import division, print_function\nimport os, sys\nfrom io import BytesIO, IOBase\nif sys.version_info[0] < 3:\n\tfrom __builtin__ import xrange as range\n\tfrom future_builtins import ascii, filter, hex, map, oct, zip\n\ndef ii():\n\treturn int(input())\n\ndef si():\n\treturn input()\n\ndef mi():\n\treturn map(int, input().split())\n\ndef li():\n\treturn list(mi())\n\ndef gcd(x, y):\n\twhile y:\n\t\t(x, y) = (y, x % y)\n\treturn x\n\ndef read():\n\tsys.stdin = open('input.txt', 'r')\n\tsys.stdout = open('output.txt', 'w')\nimport math\nmod = 10 ** 9\nmod += 7\n\ndef main():\n\tfor i in range(ii()):\n\t\t(a, b, x, y) = mi()\n\t\tc = max(a - x - 1, x)\n\t\td = max(b - y - 1, y)\n\t\tf = d * a\n\t\te = c * b\n\t\tprint(max(e, f))\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n\ndef print(*args, **kwargs):\n\t(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))\n\tat_start = True\n\tfor x in args:\n\t\tif not at_start:\n\t\t\tfile.write(sep)\n\t\tfile.write(str(x))\n\t\tat_start = False\n\tfile.write(kwargs.pop('end', '\\n'))\n\tif kwargs.pop('flush', False):\n\t\tfile.flush()\nif sys.version_info[0] < 3:\n\t(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))\nelse:\n\t(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nmain()\n", "num = int(input())\n\ndef find_size(num):\n\tfor i in range(num):\n\t\t(a, b, x, y) = [int(i) for i in input().split(' ')]\n\t\tprint(max((a - x - 1) * b, (b - y - 1) * a, x * b, y * a))\nfind_size(num)\n", "t = int(input())\nwhile t > 0:\n\t(a, b, x, y) = tuple([int(i) for i in input().split()])\n\tA1 = a * max(b - y - 1, y)\n\tA2 = b * max(a - x - 1, x)\n\tprint(max(A1, A2))\n\tt -= 1\n", "for _ in range(int(input())):\n\t(a, b, x, y) = [int(x) for x in input().strip().split(' ')]\n\tA = x * b\n\tB = (a - x - 1) * b\n\tC = y * a\n\tD = (b - y - 1) * a\n\tprint(max([A, B, C, D]))\n", "for i in range(int(input())):\n\t(l, h, x, y) = map(int, input().split())\n\tprint(max(x * h, (h - y - 1) * l, l * y, (l - x - 1) * h))\n", "t = int(input())\nif 1 <= t <= 10 ** 4:\n\tfor i in range(t):\n\t\t(a, b, x, y) = input().split()\n\t\ta = int(a)\n\t\tb = int(b)\n\t\tx = int(x)\n\t\ty = int(y)\n\t\tp = x + 1\n\t\tq = y + 1\n\t\tr = p * b\n\t\ts = q * a\n\t\tu = x * b\n\t\tv = y * a\n\t\tw = a * b\n\t\tif p <= a / 2 and q <= b / 2:\n\t\t\tm = w - r\n\t\t\tn = w - s\n\t\t\tif m > n:\n\t\t\t\tprint(m)\n\t\t\telse:\n\t\t\t\tprint(n)\n\t\tif p <= a / 2 and q > b / 2:\n\t\t\tz = a * b - r\n\t\t\tif z >= v:\n\t\t\t\tprint(z)\n\t\t\telif v > z:\n\t\t\t\tprint(v)\n\t\tif p > a / 2 and q <= b / 2:\n\t\t\tz = a * b - s\n\t\t\tif z >= u:\n\t\t\t\tprint(z)\n\t\t\telif z < u:\n\t\t\t\tprint(u)\n\t\tif p > a / 2 and q > b / 2:\n\t\t\tif u >= v:\n\t\t\t\tprint(u)\n\t\t\telif v > u:\n\t\t\t\tprint(v)\n", "from sys import stdin, stdout, exit as sys_ret\n(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)\nfor _ in range(int(f_input())):\n\t(a, b, piX, piY) = map(int, f_input().split())\n\tleft = max(0, b * piX)\n\tright = max(0, b * (a - piX - 1))\n\tup = max(0, a * piY)\n\tdown = max(0, a * (b - piY - 1))\n\tf_print(str(max(left, right, up, down)) + '\\n')\n", "from collections import defaultdict, Counter\n\ndef getlist():\n\treturn list(map(int, input().split()))\n\ndef maplist():\n\treturn map(int, input().split())\n\ndef main():\n\tt = int(input())\n\tfor num in range(t):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tif x >= abs(a - x):\n\t\t\tsize1 = abs(a - abs(a - x)) * b\n\t\telse:\n\t\t\tsize1 = abs(a - (x + 1)) * b\n\t\tif y >= abs(b - y):\n\t\t\tsize2 = abs(b - abs(b - y)) * a\n\t\telse:\n\t\t\tsize2 = abs(b - (y + 1)) * a\n\t\tprint(max(size1, size2))\nmain()\n", "def solve(a, b, x, y):\n\tarea_l = a * y\n\tarea_u = x * b\n\tarea_r = a * (b - y - 1)\n\tarea_d = b * (a - x - 1)\n\treturn max(area_l, area_u, area_r, area_d)\nt = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split(' '))\n\tarea = solve(a, b, x, y)\n\tprint(area)\n", "import sys\ninput = sys.stdin.readline\nt = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\t(a1, a2) = (x, a - 1 - x)\n\t(b1, b2) = (y, b - 1 - y)\n\tans = max(a1 * b, a2 * b, b1 * a, b2 * a)\n\tprint(ans)\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\taa = b * x\n\tbb = b * (a - 1 - x)\n\tcc = a * y\n\tdd = a * (b - 1 - y)\n\tprint(max(aa, bb, cc, dd))\n", "n = int(input())\ncases = []\nfor _ in range(n):\n\tcases.append(list(map(int, input().split())))\nresults = []\nfor case in cases:\n\t(a, b, x, y) = case\n\tleft = x * b\n\tright = (a - x - 1) * b\n\ttop = a * (b - 1 - y)\n\tbottom = a * y\n\tresult = max(left, right, top, bottom)\n\tresults.append(result)\nfor result in results:\n\tprint(result)\n", "num_cases = int(input())\ndata_dictionary = {}\nfor case_number in range(1, num_cases + 1):\n\tline_data = input().split()\n\tdata_dictionary[case_number] = {'a': int(line_data[0]), 'b': int(line_data[1]), 'x': int(line_data[2]), 'y': int(line_data[3])}\n\ndef max_window_size(a, b, x, y):\n\tbox_1 = max(a - (x + 1), x) * b\n\tbox_2 = max(b - (y + 1), y) * a\n\tsize = max(box_1, box_2)\n\treturn size\nfor case in data_dictionary:\n\tprint(max_window_size(data_dictionary[case]['a'], data_dictionary[case]['b'], data_dictionary[case]['x'], data_dictionary[case]['y']))\n", "def max_area(a, b, x, y):\n\treturn max(x * b, y * a, (a - x - 1) * b, (b - y - 1) * a)\nT = int(input())\nfor t in range(T):\n\t(a, b, x, y) = list(map(int, input().strip().split()))\n\tprint(max_area(a, b, x, y))\n", "t = int(input())\nwhile t:\n\tl = list(map(int, input().split()))\n\ta = l[0]\n\tb = l[1]\n\tx = l[2]\n\ty = l[3]\n\tprint(max(b * max(x, a - x - 1), a * max(y, b - y - 1)))\n\tt -= 1\n", "try:\n\tt = input()\n\tt = int(t)\n\twhile t > 0:\n\t\tt = t - 1\n\t\ts = input()\n\t\tl = s.split()\n\t\tm = []\n\t\tfor i in range(0, len(l)):\n\t\t\tl[i] = int(l[i])\n\t\tm.append(l[2] * l[1])\n\t\tm.append(l[3] * l[0])\n\t\tm.append((l[0] - l[2] - 1) * l[1])\n\t\tm.append((l[1] - l[3] - 1) * l[0])\n\t\tm.sort()\n\t\tprint(m[3])\nexcept:\n\tpass\n", "t = int(input())\nfor i in range(t):\n\tinn = [int(x) for x in input().split()]\n\ta = inn[0]\n\tb = inn[1]\n\tx = inn[2]\n\ty = inn[3]\n\tleft = x * b\n\tright = (a - 1 - x) * b\n\tabove = a * y\n\tbelow = a * (b - 1 - y)\n\tprint(max(left, right, above, below))\n", "import sys\ninput = sys.stdin.readline\nQ = int(input())\nQuery = [list(map(int, input().split())) for _ in range(Q)]\nfor (a, b, x, y) in Query:\n\tA = [a * (b - y - 1), a * y, x * b, (a - x - 1) * b]\n\tprint(max(A))\n", "from os import path\nfrom sys import stdin, stdout\nmaxn = 200005\nif path.exists('inp.txt'):\n\tstdin = open('inp.txt', 'r')\nq = int(stdin.readline())\nfor _ in range(q):\n\t(a, b, x, y) = map(int, stdin.readline().split())\n\tans = max(x * b, (a - x - 1) * b)\n\tans = max(ans, max(y * a, (b - y - 1) * a))\n\tprint(ans)\n", "import sys\nn = int(input())\nwhile n >= 1:\n\tnumbers = input().split()\n\ta = int(numbers[0])\n\tb = int(numbers[1])\n\tx = int(numbers[2])\n\ty = int(numbers[3])\n\tx_used = x + 1\n\ty_used = y + 1\n\ta_right = a - x_used\n\ta_left = x_used - 1\n\tb_upper = y_used - 1\n\tb_lower = b - y_used\n\tsolutions = []\n\tsolutions.append(a_right * b)\n\tsolutions.append(a_left * b)\n\tsolutions.append(b_upper * a)\n\tsolutions.append(b_lower * a)\n\tsolution = max(solutions)\n\tprint(solution)\n\tn = n - 1\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split(' '))\n\tw = a - x - 1 if x < a / 2 else x\n\th = b - y - 1 if y < b / 2 else y\n\tprint(max(w * b, h * a))\n", "t = int(input())\nfor i in range(t):\n\tar = list(map(int, input().rstrip().split()))\n\tx = ar[2] + 1\n\ty = ar[3] + 1\n\ta = ar[0]\n\tb = ar[1]\n\tmaxarea = (a - x) * b\n\tarea = (y - 1) * a\n\tif area > maxarea:\n\t\tmaxarea = area\n\tarea = (x - 1) * b\n\tif area > maxarea:\n\t\tmaxarea = area\n\tarea = a * (b - y)\n\tif area > maxarea:\n\t\tmaxarea = area\n\tprint(maxarea)\n", "import math\nt = int(input())\nfor g in range(0, t):\n\tabxy = list(map(int, input().split()))\n\ta = abxy[0]\n\tb = abxy[1]\n\tx = abxy[2]\n\ty = abxy[3]\n\tarr = []\n\tarr.append(a * y)\n\tarr.append(a * (b - y - 1))\n\tarr.append(b * x)\n\tarr.append(b * (a - x - 1))\n\tprint(max(arr))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tr = max([a * y, a * (b - y - 1), b * x, b * (a - x - 1)])\n\tprint(r)\n", "import sys\nfrom collections import defaultdict as dd\nfrom collections import deque\nfrom functools import *\nfrom fractions import Fraction as f\nfrom copy import *\nfrom bisect import *\nfrom heapq import *\nfrom itertools import permutations, product\n\ndef eprint(*args):\n\tprint(*args, file=sys.stderr)\nzz = 1\nif zz:\n\tinput = sys.stdin.readline\nelse:\n\tsys.stdin = open('input.txt', 'r')\n\tsys.stdout = open('all.txt', 'w')\n\ndef inc(d, c):\n\td[c] = d[c] + 1 if c in d else 1\n\ndef bo(i):\n\treturn ord(i) - ord('A')\n\ndef li():\n\treturn [int(xx) for xx in input().split()]\n\ndef fli():\n\treturn [float(x) for x in input().split()]\n\ndef comp(a, b):\n\tif a > b:\n\t\treturn 2\n\treturn 2 if a == b else 0\n\ndef gi():\n\treturn [xx for xx in input().split()]\n\ndef fi():\n\treturn int(input())\n\ndef pro(a):\n\treturn reduce(lambda a, b: a * b, a)\n\ndef swap(a, i, j):\n\t(a[i], a[j]) = (a[j], a[i])\n\ndef si():\n\treturn list(input().rstrip())\n\ndef mi():\n\treturn map(int, input().split())\n\ndef gh():\n\tsys.stdout.flush()\n\ndef isvalid(i, j):\n\treturn 0 <= i < n and 0 <= j < n\n\ndef graph(n, m):\n\tfor i in range(m):\n\t\t(x, y) = mi()\n\t\ta[x].append(y)\n\t\ta[y].append(x)\nt = fi()\nwhile t > 0:\n\tt -= 1\n\t(a, b, x, y) = mi()\n\tmaxi = max([x * b, (a - x - 1) * b, y * a, (b - y - 1) * a])\n\tprint(maxi)\n", "n = int(input())\ncases = []\nfor i in range(n):\n\tcases.append(list(map(int, input().split())))\nfor i in cases:\n\tx = i[0]\n\ty = i[1]\n\ta = i[2]\n\tb = i[3]\n\tone = y * a\n\ttwo = y * (x - a - 1)\n\tthree = x * (y - b - 1)\n\tfour = x * b\n\tfoo = [one, two, three, four]\n\tprint(max(foo))\n", "def dead():\n\tt = int(input())\n\tfor i in range(t):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tif 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):\n\t\t\treturn\n\t\tx += 1\n\t\ty += 1\n\t\tB = a * (y - 1)\n\t\tT = a * (b - y)\n\t\tL = (x - 1) * b\n\t\tR = (a - x) * b\n\t\tprint(max(B, T, L, R))\ndead()\n", "import sys\ninput = sys.stdin.readline\nt = int(input())\nfor _ in range(t):\n\t(h, w, x, y) = map(int, input().split())\n\tcan = [h * y, h * (w - 1 - y), w * x, w * (h - 1 - x)]\n\tprint(max(can))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\trow = max(a - x, x - 1)\n\tcol = max(b - y, y - 1)\n\tresult = max(row * b, a * col)\n\tprint(result)\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tX = max(x, a - x - 1)\n\tY = max(y, b - y - 1)\n\tprint(max(X * b, Y * a))\n", "n = int(input())\nans = []\nfor i in range(n):\n\t(a, b, x, y) = map(int, input().split())\n\t(x, y) = (x + 1 if x < a / 2 else a - x, y + 1 if y < b / 2 else b - y)\n\tans.append(max((b - y) * a, (a - x) * b))\nprint(*ans, sep='\\n')\n", "for _ in range(int(input())):\n\tX = list(map(int, input().split()))\n\t(MaxRow, MaxColumn) = (max(X[0] - X[2] - 1, X[2]), max(X[1] - X[3] - 1, X[3]))\n\tprint(max(MaxRow * X[1], MaxColumn * X[0]))\n", "import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy\nsys.setrecursionlimit(10 ** 7)\ninf = 10 ** 20\nmod = 10 ** 9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\ndef LI():\n\treturn [int(x) for x in sys.stdin.readline().split()]\n\ndef I():\n\treturn int(sys.stdin.readline())\n\ndef F():\n\treturn float(sys.stdin.readline())\n\ndef LS():\n\treturn sys.stdin.readline().split()\n\ndef S():\n\treturn input()\n\ndef main():\n\tn = I()\n\tans = []\n\tfor _ in range(n):\n\t\t(a, b, c, d) = LI()\n\t\tx = max(c, a - (c + 1))\n\t\ty = max(d, b - (d + 1))\n\t\tsm_a = x * b\n\t\tsm_b = a * y\n\t\tans.append(max(sm_a, sm_b))\n\tfor x in ans:\n\t\tprint(x)\nmain()\n", "import math as m\nT = int(input())\nfor t in range(0, T):\n\t(a, b, x, y) = map(int, input().split())\n\tcombs = [x * b, (a - x - 1) * b, y * a, (b - y - 1) * a]\n\tprint(f'{max(combs)}')\n", "t = int(input())\nvec = []\nfor i in range(t):\n\t(a, b, x, y) = [int(j) for j in input().split(' ')]\n\tvec.append(max(max(a - x - 1, x) * b, max(b - y - 1, y) * a))\nfor j in vec:\n\tprint(j)\n", "for t in range(int(input())):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\tl = max(x, a - 1 - x)\n\th = max(y, b - 1 - y)\n\tprint(max(l * b, h * a))\n", "for q in range(int(input())):\n\tx = list(map(int, input().split()))\n\ti = 0\n\tif (x[0] - x[2] - 1) * x[1] >= i:\n\t\ti = (x[0] - x[2] - 1) * x[1]\n\tif x[1] * x[2] >= i:\n\t\ti = x[1] * x[2]\n\tif x[0] * x[3] >= i:\n\t\ti = x[0] * x[3]\n\tif x[0] * (x[1] - x[3] - 1) >= i:\n\t\ti = x[0] * (x[1] - x[3] - 1)\n\tprint(i)\n", "import math\nt = int(input())\nfor tt in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tt1 = b * x\n\tt2 = (a - x - 1) * b\n\tt3 = a * y\n\tt4 = a * (b - y - 1)\n\tprint(max(t1, t2, t3, t4))\n", "test_case = int(input())\n\ndef count_up(len_y, dead_y):\n\tarea = len_y * (dead_y - 0)\n\treturn area\n\ndef count_down(len_y, dead_y, last_down):\n\tarea = len_y * (last_down - 1 - dead_y)\n\treturn area\n\ndef count_right(len_x, dead_x, last_right):\n\tarea = len_x * (last_right - 1 - dead_x)\n\treturn area\n\ndef count_left(len_x, dead_x):\n\tarea = len_x * (dead_x - 0)\n\treturn area\nwhile test_case > 0:\n\t(length, width, dead_pixel_x, dead_pixel_y) = input().split()\n\tlength = int(length)\n\twidth = int(width)\n\tdead_pixel_x = int(dead_pixel_x)\n\tdead_pixel_y = int(dead_pixel_y)\n\tall_up = count_up(length, dead_pixel_y)\n\tall_down = count_down(length, dead_pixel_y, width)\n\tall_right = count_right(width, dead_pixel_x, length)\n\tall_left = count_left(width, dead_pixel_x)\n\tprint(max(all_down, all_left, all_right, all_up))\n\ttest_case -= 1\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tw = max(a - 1 - x, x)\n\th = max(b - 1 - y, y)\n\tans = max(w * b, h * a)\n\tprint(ans)\n", "from sys import stdin\ninput = stdin.readline\nfor _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\ttop = y * a\n\tbottom = (b - y - 1) * a\n\tright = (a - x - 1) * b\n\tleft = x * b\n\tprint(max([top, bottom, left, right]))\n", "for q in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tres = 0\n\tif y != 0:\n\t\tres = max(res, (y - 1 + 1) * a)\n\tif y + 1 != b:\n\t\tres = max(res, (b - y - 1) * a)\n\tif x != 0:\n\t\tres = max(res, (x - 1 + 1) * b)\n\tif x + 1 != a:\n\t\tres = max(res, (a - x - 1) * b)\n\tprint(res)\n", "num = int(input())\nfor i in range(num):\n\tcoords = [int(i) for i in input().split(' ')]\n\tprint(max(coords[0] * coords[3], coords[1] * coords[2], coords[0] * (coords[1] - coords[3] - 1), coords[1] * (coords[0] - coords[2] - 1)))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tk = a - x - 1\n\tm = b - y - 1\n\tk = k * b\n\tm = m * a\n\tp = x * b\n\tq = y * a\n\tA = max(k, m, p, q)\n\tprint(A)\n", "import sys\nsys.setrecursionlimit(10 ** 6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep='\\n')\n\ndef II():\n\treturn int(sys.stdin.readline())\n\ndef MI():\n\treturn map(int, sys.stdin.readline().split())\n\ndef LI():\n\treturn list(map(int, sys.stdin.readline().split()))\n\ndef LLI(rows_number):\n\treturn [LI() for _ in range(rows_number)]\n\ndef SI():\n\treturn sys.stdin.readline()[:-1]\n\ndef main():\n\tt = II()\n\tfor _ in range(t):\n\t\t(a, b, x, y) = MI()\n\t\tprint(max(x * b, (a - x - 1) * b, a * y, a * (b - y - 1)))\nmain()\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = [int(i) for i in input().split()]\n\tl = (x - 0) * b\n\tr = (a - 1 - x) * b\n\tu = (b - 1 - y) * a\n\tlo = (y - 0) * a\n\tg = max(l, r)\n\th = max(lo, u)\n\tprint(max(g, h))\n", "num = int(input())\narr = []\nfor i in range(num):\n\tarr.append(input())\narr = [[int(i) for i in c.split(' ')] for c in arr]\nfor i in range(num):\n\tprint(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]))\n", "t = int(input())\nfor i in range(t):\n\tpossibile_area = []\n\tpack = list(map(int, input().split(' ')))\n\tpossibile_area.append((pack[0] - pack[2] - 1) * pack[1])\n\tpossibile_area.append(pack[2] * pack[1])\n\tpossibile_area.append(pack[0] * (pack[1] - pack[3] - 1))\n\tpossibile_area.append(pack[0] * pack[3])\n\tprint(max(possibile_area))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tA1 = x * b\n\tA2 = y * a\n\tA3 = (a - 1 - x) * b\n\tA4 = (b - 1 - y) * a\n\tprint(max(A1, A2, A3, A4))\n", "n = int(input())\nfor i in range(n):\n\t(x, y, a, b) = map(int, input().split())\n\ts = []\n\ts.append(x * b)\n\ts.append(x * (y - (b + 1)))\n\ts.append(y * a)\n\ts.append(y * (x - (a + 1)))\n\tprint(max(s))\n", "from sys import stdin, stdout\n\ndef make_window():\n\tn = int(stdin.readline())\n\tfor lines in range(n):\n\t\tscreen = map(int, stdin.readline().split())\n\t\tscreen = list(screen)\n\t\tbad_row = screen[3]\n\t\tbad_col = screen[2]\n\t\thigh_rows = 0\n\t\trows = 0\n\t\thigh_cols = 0\n\t\tcols = 0\n\t\tfor row in range(screen[1]):\n\t\t\tif row == bad_row:\n\t\t\t\trows = 0\n\t\t\t\tcontinue\n\t\t\telse:\n\t\t\t\trows += 1\n\t\t\t\thigh_rows = max(high_rows, rows)\n\t\tfor col in range(screen[0]):\n\t\t\tif col == bad_col:\n\t\t\t\tcols = 0\n\t\t\t\tcontinue\n\t\t\telse:\n\t\t\t\tcols += 1\n\t\t\t\thigh_cols = max(high_cols, cols)\n\t\tstdout.write('%d\\n' % max(high_cols * screen[1], high_rows * screen[0]))\nmake_window()\n", "import math\nt = int(input())\nans = []\nfor i in range(t):\n\t(a, b, x, y) = input().split()\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\tarea = max(b * max(x, a - 1 - x), a * max(y, b - 1 - y))\n\tans.append(area)\nfor i in range(len(ans)):\n\tprint(ans[i])\n", "def calc(a: int, b: int, x: int, y: int):\n\tans1: int = x * b\n\tans2: int = b * (a - x - 1)\n\tans3: int = a * y\n\tans4: int = a * (b - y - 1)\n\treturn max(ans1, ans2, ans3, ans4)\n\ndef main():\n\tfor i in range(int(input())):\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tans: int = calc(a, b, x, y)\n\t\tprint(ans)\nmain()\n", "t = int(input())\nwhile t > 0:\n\t(a, b, x, y) = input().split(' ')\n\ta = int(a)\n\tb = int(b)\n\tx = int(x)\n\ty = int(y)\n\tarea = max((a - 1 - x) * b, x * b, a * y, a * (b - 1 - y))\n\tprint(area)\n\tt -= 1\n", "def dead_pixel(a, b, x, y):\n\ttop = x * b\n\tleft = y * a\n\tbottom = (a - x - 1) * b\n\tright = a * (b - y - 1)\n\treturn max(left, right, top, bottom)\nt = int(input())\nfor i in range(t):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tprint(dead_pixel(a, b, x, y))\n", "t = int(input())\nfor _ in range(t):\n\t(a, b, x, y) = map(int, input().split(' '))\n\tx = x + 1\n\ty = y + 1\n\tt1 = a * (y - 1)\n\tt2 = a * abs(b - y)\n\tt3 = b * (x - 1)\n\tt4 = b * abs(a - x)\n\tprint(max(t1, t2, t3, t4))\n", "t = int(input())\nfor o in range(t):\n\t[a, b, x, y] = list(map(int, input().rstrip().split()))\n\ts1 = a * y\n\ts2 = b * x\n\ts3 = a * (b - y - 1)\n\ts4 = b * (a - x - 1)\n\td = max(s1, s2)\n\tf = max(s3, s4)\n\tp = max(d, f)\n\tprint(p)\n", "t = int(input())\nfor i in range(t):\n\tposs = []\n\t(a, b, x, y) = map(int, input().split())\n\tresCol = x * b\n\tresCol2 = (a - x - 1) * b\n\tresRow = a * y\n\tresRow2 = (b - y - 1) * a\n\tposs.append(resCol)\n\tposs.append(resCol2)\n\tposs.append(resRow)\n\tposs.append(resRow2)\n\tprint(max(poss))\n", "testcases = int(input())\nlis = []\nfor i in range(testcases):\n\ttup = tuple(map(int, input().split(' ')))\n\tlis.append(tup)\n\ndef maxcalc(tupl):\n\tdpx = tupl[2]\n\tdpy = tupl[3]\n\tscry = tupl[1]\n\tscrx = tupl[0]\n\tc1 = dpy * scrx\n\tc2 = scry * scrx - c1 - scrx\n\tc3 = dpx * scry\n\tc4 = scry * scrx - c3 - scry\n\treturn max(c1, c2, c3, c4)\nfor tuple in lis:\n\tprint(maxcalc(tuple))\n", "m = int(input())\nl = []\nfor i in range(m):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\tt1 = (a - x) * b\n\tt2 = (x - 1) * b\n\tt3 = (b - y) * a\n\tt4 = (y - 1) * a\n\tl.append(max(t1, t2, t3, t4))\nfor i in l:\n\tprint(i)\n", "for tc in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tans = max(max(x, a - x - 1) * b, a * max(b - y - 1, y))\n\tprint(ans)\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tp1 = max(x, a - x - 1) * b\n\tp2 = a * max(y, b - y - 1)\n\tprint(max(p1, p2))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tx += 1\n\ty += 1\n\td1 = a - x\n\td2 = x - 1\n\tf1 = b - y\n\tf2 = y - 1\n\ta1 = d1 * b\n\ta2 = d2 * b\n\ta3 = f1 * a\n\ta4 = f2 * a\n\tprint(max(a1, a2, a3, a4))\n", "from sys import stdin, gettrace\nif not gettrace():\n\n\tdef input():\n\t\treturn next(stdin)[:-1]\n\ndef main():\n\n\tdef solve():\n\t\t(a, b, x, y) = map(int, input().split())\n\t\tr1 = a * y\n\t\tr2 = a * (b - y - 1)\n\t\tr3 = b * x\n\t\tr4 = b * (a - x - 1)\n\t\tprint(max(r1, r2, r3, r4))\n\tq = int(input())\n\tfor _ in range(q):\n\t\tsolve()\nmain()\n", "for o in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\ta1 = a * max(y, b - y - 1)\n\ta2 = b * max(x, a - x - 1)\n\tprint(max(a1, a2))\n", "t = int(input())\n\ndef main(string):\n\tsplit = string.split()\n\ta = int(split[0])\n\tb = int(split[1])\n\tx = int(split[2]) + 1\n\ty = int(split[3]) + 1\n\tif a == 1:\n\t\treturn max(b - y, y - 1)\n\telif b == 1:\n\t\treturn max(a - x, x - 1)\n\telse:\n\t\tmax_1 = max(a - x, x - 1)\n\t\tmax_2 = max(b - y, y - 1)\n\t\treturn max(max_1 * b, max_2 * a)\nresults = []\nfor i in range(t):\n\tstring = input()\n\tresults.append(main(string))\nfor result in results:\n\tprint(result)\n", "t = int(input())\nwhile t:\n\tt -= 1\n\t(a, b, x, y) = map(int, input().split())\n\tarea1 = a * y\n\tarea2 = x * b\n\tarea3 = (a - 1 - x) * b\n\tarea4 = a * (b - 1 - y)\n\tprint(max(area1, area2, area3, area4))\n", "for _ in range(int(input())):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tx += 1\n\ty += 1\n\td = (a - x) * b\n\tr = (x - 1) * b\n\te = a * (b - y)\n\tf = a * (y - 1)\n\tprint(max(d, r, e, f))\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = [int(x) for x in input().split()]\n\th_below = b - (y + 1)\n\th_above = b - (h_below + 1)\n\tbeside_right = a - (x + 1)\n\tbeside_left = a - (beside_right + 1)\n\tarea_above = h_above * a\n\tarea_below = h_below * a\n\tarea_left = beside_left * b\n\tarea_right = beside_right * b\n\tprint(max(area_above, area_below, area_left, area_right))\n", "def two(a, b, x, y):\n\tlen = abs(a - x) if abs(a - x) >= abs(x) else x - 1\n\topt1 = len * b\n\tlen = abs(b - y) if abs(b - y) >= abs(y) else y - 1\n\topt2 = len * a\n\treturn opt1 if opt1 > opt2 else opt2\nt = int(input())\ni = 0\nwhile i < t:\n\tx = input().split()\n\tprint(two(int(x[0]), int(x[1]), int(x[2]) + 1, int(x[3]) + 1))\n\ti = i + 1\n", "import sys\n\ndef rr():\n\treturn sys.stdin.readline().rstrip()\nrp = print\n\ndef print(*args, **kwargs):\n\trp('DBG:# ', *args, **kwargs, file=sys.stderr)\n\ndef rri():\n\treturn int(rr())\n\ndef rrl():\n\treturn list(map(int, rr().split()))\n\ndef rrt():\n\treturn tuple(map(int, rr().split()))\n\ndef rrle():\n\treturn (line.rstrip() for line in sys.stdin.readlines())\n\ndef rrtl():\n\treturn [tuple(map(int, l.split())) for l in rrle()]\nfrom collections import defaultdict\n\ndef mus(d=lambda : 0):\n\treturn defaultdict(lambda : defaultdict(d))\n\ndef dd0(d=lambda : 0):\n\treturn defaultdict(d)\n\ndef ms(x, y, d=0):\n\treturn [[0] * y for i in range(x)]\n\ndef ar(x, d=0):\n\treturn [d] * x\n\ndef ppm(m, n=0, x=0, y=0):\n\tprint('\\n'.join(('\\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))\n\ndef ppa(a, n):\n\tprint('\\t'.join(map(str, a[0:n])))\n\ndef ppl(a=0, x=[1]):\n\tx[0] = a or x[0] + 1\n\tprint('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')\n\ndef fltn(a):\n\t(i for sub in a for i in sub)\n\ndef yn(x):\n\treturn 'YES' if x else 'NO'\nfrom itertools import tee\nfrom itertools import accumulate\nfrom itertools import groupby\nfrom itertools import permutations\n\ndef pairwise(iterable):\n\t(a, b) = tee(iterable)\n\tnext(b, None)\n\treturn zip(a, b)\n\ndef grp(x, key=None):\n\treturn ((i, sum((1 for _ in g))) for (i, g) in groupby(x, key=key))\nimport math\n\ndef rnar():\n\treturn (*rrl(), rrl())\n\ndef rn():\n\treturn (*rrl(),)\n\ndef dpp(a, b=''):\n\tprint('#| {} |#:^ {} ^:'.format(a, b))\n\ndef str_join(i, sep=' '):\n\treturn sep.join(map(str, i))\nMOD17 = 10 ** 9 + 7\n\ndef read():\n\treturn rrl()\n\ndef solve(a, b, x, y):\n\tt1 = max(x, a - x - 1) * b\n\tt2 = max(y, b - y - 1) * a\n\tans = max(t1, t2)\n\treturn ans\ntest_count = rri()\nfor _ in range(test_count):\n\tinput_data = read()\n\tresult = solve(*input_data)\n\trp(result)\n", "import sys\nimport bisect\n\ndef metod(x):\n\tif t[x] == 'A':\n\t\tw = a\n\telse:\n\t\tw = b\n\tfor i in range(x + 1, len(t) - 1):\n\t\tif t[i] != t[i - 1]:\n\t\t\tif t[i] == 'A':\n\t\t\t\tw += a\n\t\t\telse:\n\t\t\t\tw += b\n\treturn w\n\ndef morzermorzer():\n\t(a, b, x, y) = map(int, input().split())\n\tprint(max(y * a, (b - y - 1) * a, x * b, (a - x - 1) * b))\nfor morzer in range(int(input())):\n\tmorzermorzer()\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tj = b - y - 1\n\tj = max(j, y)\n\tk = a - x - 1\n\tk = max(k, x)\n\tprint(max(j * a, k * b))\n", "import sys\nfor t in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tkv1 = x * y\n\tkv2 = y * a\n\tkv3 = x * b\n\tkv5 = (a - (x + 1)) * b\n\tkv4 = (b - (y + 1)) * a\n\tprint(max(kv5, kv1, kv2, kv3, kv4))\n", "t = int(input())\nwhile t:\n\t(a, b, x, y) = map(int, input().split())\n\t(x, y) = (x + 1, y + 1)\n\tresult = max(a * (y - 1), a * (b - y), (x - 1) * b, (a - x) * b)\n\tprint(result)\n\tt -= 1\n", "for t in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\ta1 = a - x - 1\n\tb1 = b - y - 1\n\tc = x * b\n\td = y * a\n\te = a1 * b\n\tf = b1 * a\n\tll = max(c, d, e, f)\n\tprint(ll)\n", "result = []\n\ndef main():\n\tn = int(input())\n\tfor i in range(0, n):\n\t\tm = list(map(int, input().split()))\n\t\tr1 = (m[0] - m[2] - 1) * m[1]\n\t\tr2 = (m[1] - m[3] - 1) * m[0]\n\t\tr3 = (m[2] - 1 + 1) * m[1]\n\t\tr4 = (m[3] - 1 + 1) * m[0]\n\t\tresult.append(max(r1, r2, r3, r4))\n\tfor i in result:\n\t\tprint(i)\nmain()\n", "t = int(input())\nwhile t > 0:\n\t(a, b, x, y) = [int(x) for x in input().split()]\n\tp = x if x >= a - 1 - x else a - 1 - x\n\tq = y if y >= b - 1 - y else b - 1 - y\n\ta1 = p * b\n\ta2 = q * a\n\tif a1 >= a2:\n\t\tprint(a1)\n\telse:\n\t\tprint(a2)\n\tt -= 1\n", "from pprint import pprint\nimport sys\ninput = sys.stdin.readline\nq = int(input())\nfor _ in range(q):\n\t(a, b, x, y) = map(int, input().split())\n\tr1 = a * y\n\tr2 = a * (b - y - 1)\n\tr3 = b * x\n\tr4 = b * (a - x - 1)\n\tres = max(r1, r2, r3, r4)\n\tprint(res)\n", "t = int(input())\nfor _ in range(0, t):\n\t(a, b, x, y) = map(int, input().split())\n\trow = a - 1\n\tcol = b - 1\n\tif row == 0:\n\t\ttemp = col - y\n\t\tif temp > y:\n\t\t\tprint(temp)\n\t\telse:\n\t\t\tprint(y)\n\telif col == 0:\n\t\ttemp = row - x\n\t\tif temp > x:\n\t\t\tprint(temp)\n\t\telse:\n\t\t\tprint(x)\n\telif x == y == 0:\n\t\ttmp1 = (a - 1) * b\n\t\ttmp2 = a * (b - 1)\n\t\tif tmp1 > tmp2:\n\t\t\tprint(tmp1)\n\t\telse:\n\t\t\tprint(tmp2)\n\telse:\n\t\ttmp1 = x * b\n\t\ttmp2 = (row - x) * b\n\t\ttmp3 = a * y\n\t\ttmp4 = a * (col - y)\n\t\tlst = [tmp1, tmp2, tmp3, tmp4]\n\t\tprint(max(lst))\n", "def main():\n\tT = int(input())\n\tfor i in range(T):\n\t\t(a, b, x, y) = input().split()\n\t\tm = int(x)\n\t\tn = int(a) - (int(x) + 1)\n\t\tp = int(y)\n\t\tq = int(b) - (int(y) + 1)\n\t\tArea = max(max(m, n) * int(b), max(p, q) * int(a))\n\t\tprint(Area)\nmain()\n", "for i in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tx = x + 1\n\ty = y + 1\n\tar1 = a - x\n\tar2 = a - (ar1 + 1)\n\tbc1 = b - y\n\tbc2 = b - (bc1 + 1)\n\tmx = max(ar1 * b, ar2 * b, bc1 * a, bc2 * a)\n\tprint(mx)\n", "t = int(input())\nwhile t != 0:\n\t(a, b, x, y) = map(int, input().split())\n\tm = max(y, b - 1 - y)\n\tn = max(x, a - x - 1)\n\to = max(b * n, m)\n\tp = max(o, n)\n\tq = max(a * m, p)\n\tprint(q)\n\tt = t - 1\n", "for _ in range(int(input())):\n\t(a, b, x, y) = [int(i) for i in input().strip().split()]\n\ta1 = y * a\n\ta2 = (b - 1 - y) * a\n\ta3 = x * b\n\ta4 = (a - 1 - x) * b\n\tans = max(a1, a2, a3, a4)\n\tprint(ans)\n", "def mi():\n\treturn map(int, input().split())\n\ndef li():\n\treturn list(mi())\n\ndef ii():\n\treturn int(input())\n\ndef si():\n\treturn input()\nt = ii()\nwhile t:\n\tt -= 1\n\t(a, b, x, y) = mi()\n\tans = 0\n\tans = max(ans, a * y)\n\tans = max(ans, b * x)\n\tx += 1\n\ty += 1\n\tans = max(ans, (a - x) * b)\n\tans = max(ans, (b - y) * a)\n\tprint(ans)\n", "from sys import stdin, stdout\nPi = lambda x: stdout.write(str(x) + '\\n')\nS = lambda x: x * (x + 1) // 2\nR = lambda : stdin.readline()\nRi = lambda x: map(int, x.split())\n\ndef ver(a, b, x, y):\n\top1 = max(x, a - x - 1) * b\n\top2 = max(y, b - 1 - y) * a\n\treturn max(op1, op2)\n\ndef f(n, k):\n\tr = min(n - k, k)\n\tans = 1\n\tfor i in range(1, r + 1):\n\t\tans = ans * (n - i + 1) // i\n\treturn ans\n\ndef main():\n\tfor x in stdin:\n\t\tn = int(x)\n\t\tans = 0\n\t\tfor i in range(1, n + 1):\n\t\t\t(a, b, x, y) = Ri(R())\n\t\t\tPi(ver(a, b, x, y))\nmain()\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tx = x + 1\n\ty = y + 1\n\teast = (b - (b - y + 1)) * a\n\twest = (b - y) * a\n\tnorth = (a - (a - x + 1)) * b\n\tsouth = (a - x) * b\n\tif east >= west and east >= north and (east >= south):\n\t\tprint(east)\n\telif west >= east and west >= north and (west >= south):\n\t\tprint(west)\n\telif north >= east and north >= west and (north >= south):\n\t\tprint(north)\n\telif south >= east and south >= west and (south >= north):\n\t\tprint(south)\n", "for n in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\tl = x * b\n\tw = (a - x - 1) * b\n\tv = a * y\n\tn = a * (b - y - 1)\n\tprint(max(l, w, v, n))\n", "def solve(a, b, x, y):\n\tcol = max(b - 1 - y, y)\n\tarea_col = col * a\n\trow = max(a - 1 - x, x)\n\tarea_row = row * b\n\treturn max(area_col, area_row)\nn = input()\nfor x in range(0, int(n)):\n\tline = input()\n\tline_arr = line.split(' ')\n\t(a, b, x, y) = list(map(lambda x: int(x), line_arr))\n\tprint(solve(a, b, x, y))\n", "import sys\nimport math\nimport heapq\nimport collections\nfast_reader = sys.stdin.readline\nfast_writer = sys.stdout.write\n\ndef input():\n\treturn fast_reader().strip()\n\ndef print(*argv):\n\tfast_writer(' '.join((str(i) for i in argv)))\n\tfast_writer('\\n')\n\ndef printspace(*argv):\n\tfast_writer(' '.join((str(i) for i in argv)))\n\tfast_writer(' ')\n\ndef inputnum():\n\treturn int(input())\n\ndef inputnums():\n\treturn map(int, input().split())\n\ndef inputlist():\n\treturn list(map(int, input().split()))\n\ndef inputstring():\n\treturn [x for x in input()]\n\ndef inputstringnum():\n\treturn [ord(x) - ord('a') for x in input()]\n\ndef inputmatrixchar(rows):\n\tarr2d = [[j for j in input().strip()] for i in range(rows)]\n\treturn arr2d\n\ndef inputmatrixint(rows):\n\tarr2d = []\n\tfor _ in range(rows):\n\t\tarr2d.append([int(i) for i in input().split()])\n\treturn arr2d\nt = int(input())\nfor q in range(t):\n\t(a, b, x, y) = inputnums()\n\tprint(max(a * max(y, b - y - 1), b * max(x, a - x - 1)))\n", "T = int(input())\nfor i in range(T):\n\t(a, b, x, y) = map(int, input().split())\n\tx = x + 1\n\ty = y + 1\n\tif a == 1:\n\t\tw = abs(y - 1)\n\t\tq = abs(b - y)\n\t\tif w >= q:\n\t\t\tprint(w)\n\t\telse:\n\t\t\tprint(q)\n\telif b == 1:\n\t\tw = abs(x - 1)\n\t\tq = abs(a - x)\n\t\tif w >= q:\n\t\t\tprint(w)\n\t\telse:\n\t\t\tprint(q)\n\telse:\n\t\tw = abs(x - 1) * b\n\t\tq = abs(a - x) * b\n\t\tz = abs(y - 1) * a\n\t\tp = abs(b - y) * a\n\t\ts = max(w, q, z, p)\n\t\tprint(s)\n", "for _ in range(int(input())):\n\tq = []\n\tfor i in input().split():\n\t\tq.append(i)\n\ta = int(q[0])\n\tb = int(q[1])\n\tx = int(q[2])\n\ty = int(q[3])\n\tq1 = []\n\tq1.append(x * b)\n\tq1.append((a - x - 1) * b)\n\tq1.append(a * y)\n\tq1.append(a * (b - y - 1))\n\tq1.sort()\n\tprint(q1[3])\n", "from bisect import bisect_left as bl\nfrom bisect import bisect_right as br\nimport heapq\nimport math\nfrom collections import *\nfrom functools import reduce, cmp_to_key\nimport sys\ninput = sys.stdin.readline\nM = mod = 10 ** 9 + 7\n\ndef factors(n):\n\treturn sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))\n\ndef inv_mod(n):\n\treturn pow(n, mod - 2, mod)\n\ndef li():\n\treturn [int(i) for i in input().rstrip('\\n').split(' ')]\n\ndef st():\n\treturn input().rstrip('\\n')\n\ndef val():\n\treturn int(input().rstrip('\\n'))\n\ndef li2():\n\treturn [i for i in input().rstrip('\\n').split(' ')]\n\ndef li3():\n\treturn [int(i) for i in input().rstrip('\\n')]\n\ndef givemax(x, y):\n\treturn max(x * (y + 1), y * (x + 1))\nfor _ in range(val()):\n\t(a, b, x, y) = li()\n\tx += 1\n\ty += 1\n\tm1 = max(0, (x - 1) * y, (y - 1) * x)\n\tm2 = max((a - x) * (y - 1), y * (a - x - 1))\n\tm3 = max(x * (b - y - 1), (b - y) * (x - 1))\n\tm4 = max((a - x - 1) * (b - y), (a - x) * (b - y - 1))\n\tm5 = max((x - 1) * b, (a - x) * b)\n\tm6 = max((y - 1) * a, (b - y) * a)\n\tprint(max(m1, m2, m3, m4, m5, m6))\n", "from collections import Counter\nfrom collections import defaultdict\nimport math\nt = int(input())\nfor _ in range(0, t):\n\t(a, b, c, d) = list(map(int, input().split()))\n\tm = max(b * c, b * (a - c - 1), a * (b - d - 1), a * d)\n\tprint(m)\n", "t = int(input())\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tr = y\n\ty += 1\n\tarea1 = a * (y - 1)\n\tarea2 = a * (b - y)\n\tmax1 = max(area1, area2)\n\ty = r\n\tx += 1\n\tarea1 = b * (x - 1)\n\tarea2 = b * (a - x)\n\tmax2 = max(area1, area2)\n\tprint(max(max1, max2))\n", "def solution():\n\tfor _ in range(int(input())):\n\t\t(row, column, x, y) = [int(i) for i in input().split()]\n\t\tarr = (x * column, (row - x - 1) * column, y * row, (column - y - 1) * row)\n\t\tprint(max(arr))\nsolution()\n", "for _ in range(int(input())):\n\t(a, b, x, y) = map(int, input().split())\n\ttotal = a * max(y, b - (y + 1))\n\ttotal2 = max(x, a - (x + 1)) * b\n\tprint(max(total, total2))\n", "t = int(input())\nwhile t > 0:\n\tt = t - 1\n\t(a, b, x, y) = map(int, input().split())\n\tlst = []\n\tlst.append(a * y)\n\tlst.append(b * x)\n\tx = x + 1\n\ty = y + 1\n\tx = a - x\n\ty = b - y\n\tlst.append(a * y)\n\tlst.append(b * x)\n\tprint(max(lst))\n", "for _ in range(int(input())):\n\tli = list(map(int, input().split()))\n\tc = (li[0] - li[2]) * (li[1] - li[3] - 1)\n\td = (li[0] - li[2] - 1) * (li[1] - li[3])\n\tkli = []\n\tkli.append(li[0] * (li[1] - li[3] - 1))\n\tkli.append(li[0] * li[3])\n\tkli.append(li[1] * (li[0] - li[2] - 1))\n\tkli.append(li[1] * li[2])\n\tprint(max(kli))\n", "t = int(input())\nwhile t > 0:\n\tt -= 1\n\t(a, b, x, y) = list(map(int, input().split(' ')))\n\tnb = ()\n\tif y < b / 2:\n\t\tnb = b - y - 1\n\telse:\n\t\tnb = y\n\tna = ()\n\tif x < a / 2:\n\t\tna = a - x - 1\n\telse:\n\t\tna = x\n\tif a * nb >= na * b:\n\t\tprint(a * nb)\n\telse:\n\t\tprint(na * b)\n", "for i in range(int(input())):\n\tparams = [int(i) for i in input().split()]\n\th = max(params[0] - (params[2] + 1), params[2])\n\tw = max(params[1] - (params[3] + 1), params[3])\n\tprint(max(h * params[1], w * params[0]))\n", "for n in range(int(input())):\n\tc = input().split(' ')\n\ta = int(c[0])\n\tb = int(c[1])\n\tx = int(c[2])\n\ty = int(c[3])\n\thalfA = a / 2\n\thalfB = b / 2\n\tdifA = a - x - 1\n\tdifB = b - y - 1\n\tif difB < halfB:\n\t\tdifB = y\n\tif difA < halfA:\n\t\tdifA = x\n\tif a * difB > difA * b:\n\t\tprint(a * difB)\n\telse:\n\t\tprint(b * difA)\n", "n = int(input())\nfor i in range(n):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tmax1 = max(x * b, (a - 1 - x) * b)\n\tmax2 = max(y * a, (b - 1 - y) * a)\n\tprint(max(max1, max2))\n", "def solution(l1):\n\twidth = l1[0]\n\theight = l1[1]\n\tx = l1[2] + 1\n\ty = l1[3] + 1\n\tabove = width * (height - y)\n\tbelow = width * (y - 1)\n\tleft = height * (x - 1)\n\tright = height * (width - x)\n\treturn max([above, below, left, right])\n\ndef answer():\n\tn = int(input())\n\tl1 = []\n\twhile n:\n\t\tl1 = input().split()\n\t\tl1 = [int(x) for x in l1]\n\t\tprint(solution(l1))\n\t\tn -= 1\nanswer()\n", "import os\nimport sys\nfrom io import BytesIO, IOBase\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\ntestcases = int(input())\nfor j in range(testcases):\n\tvalues = list(map(int, input().split()))\n\ta = values[0]\n\tb = values[1]\n\tx = values[2]\n\ty = values[3]\n\tarea1 = 0\n\tarea2 = 0\n\tif x < a - x:\n\t\tarea1 = (a - x - 1) * b\n\telif x >= a - x:\n\t\tarea1 = x * b\n\tif y < b - y:\n\t\tarea2 = (b - y - 1) * a\n\telif y >= b - y:\n\t\tarea2 = y * a\n\tprint(max(area1, area2))\n", "def func(width, height, x, y):\n\tup = y * width\n\tdown = (height - y - 1) * width\n\tleft = x * height\n\tright = (width - x - 1) * height\n\treturn max(up, down, left, right)\nt = int(input())\nfor i in range(t):\n\t(width, height, x, y) = map(int, input().split())\n\tres = func(width, height, x, y)\n\tprint(res)\n", "import sys\nimport os\nimport math\nimport copy\nfrom math import gcd\nfrom bisect import bisect\nfrom io import BytesIO, IOBase\nfrom math import sqrt, floor, factorial, gcd, log, ceil\nfrom collections import deque, Counter, defaultdict\nfrom itertools import permutations, combinations\nfrom itertools import accumulate\n\ndef Int():\n\treturn int(sys.stdin.readline())\n\ndef Mint():\n\treturn map(int, sys.stdin.readline().split())\n\ndef Lstr():\n\treturn list(sys.stdin.readline().strip())\n\ndef Str():\n\treturn sys.stdin.readline().strip()\n\ndef Mstr():\n\treturn map(str, sys.stdin.readline().strip().split())\n\ndef List():\n\treturn list(map(int, sys.stdin.readline().split()))\n\ndef Hash():\n\treturn dict()\n\ndef Mod():\n\treturn 1000000007\n\ndef Ncr(n, r, p):\n\treturn fact[n] * (ifact[r] * ifact[n - r] % p) % p\n\ndef Most_frequent(list):\n\treturn max(set(list), key=list.count)\n\ndef Mat2x2(n):\n\treturn [List() for _ in range(n)]\n\ndef Lcm(x, y):\n\treturn x * y // gcd(x, y)\n\ndef dtob(n):\n\treturn bin(n).replace('0b', '')\n\ndef btod(n):\n\treturn int(n, 2)\n\ndef common(l1, l2):\n\treturn set(l1).intersection(l2)\n\ndef solution():\n\tfor _ in range(Int()):\n\t\t(a, b, x, y) = Mint()\n\t\tm = max(a * y, a * (b - 1 - y))\n\t\tn = max(b * x, b * (a - 1 - x))\n\t\tprint(max(m, n))\nsolution()\n", "def deadPixel(list):\n\tbottom = list[0] * (list[1] - (list[3] + 1))\n\ttop = list[0] * list[1] - (bottom + list[0])\n\tleft = list[1] * list[2]\n\tright = list[0] * list[1] - (left + list[1])\n\treturn max([bottom, top, left, right])\nfor i in range(int(input())):\n\tprint(deadPixel(list(map(int, input().split()))))\n", "from bisect import *\nfrom collections import *\nfrom itertools import *\nimport functools\nimport sys\nimport math\nfrom decimal import *\nfrom copy import *\nfrom heapq import *\nfrom fractions import *\ngetcontext().prec = 30\nMAX = sys.maxsize\nMAXN = int(1500000.0)\nMOD = 10 ** 9 + 7\nspf = [i for i in range(MAXN)]\nspf[0] = spf[1] = -1\n\ndef sieve():\n\tfor i in range(2, MAXN, 2):\n\t\tspf[i] = 2\n\tfor i in range(3, int(MAXN ** 0.5) + 1):\n\t\tif spf[i] == i:\n\t\t\tfor j in range(i * i, MAXN, i):\n\t\t\t\tif spf[j] == j:\n\t\t\t\t\tspf[j] = i\n\ndef fib(n, m):\n\tif n == 0:\n\t\treturn [0, 1]\n\telse:\n\t\t(a, b) = fib(n // 2)\n\t\tc = a % m * (b % m * 2 - a % m) % m\n\t\td = a % m * (a % m) % m + b % m * b % m % m\n\t\tif n % 2 == 0:\n\t\t\treturn [c, d]\n\t\telse:\n\t\t\treturn [d, c + d]\n\ndef charIN(x=' '):\n\treturn sys.stdin.readline().strip().split(x)\n\ndef arrIN(x=' '):\n\treturn list(map(int, sys.stdin.readline().strip().split(x)))\n\ndef ncr(n, r):\n\tnum = den = 1\n\tfor i in range(r):\n\t\tnum = num * (n - i) % MOD\n\t\tden = den * (i + 1) % MOD\n\treturn num * pow(den, MOD - 2, MOD) % MOD\n\ndef flush():\n\treturn sys.stdout.flush()\nfor _ in range(int(input())):\n\t(a, b, x, y) = arrIN()\n\tans = max(b * x, b * (a - x - 1), a * y, a * (b - y - 1))\n\tprint(ans)\n", "for _ in range(int(input())):\n\t(a, b, x, y) = list(map(int, input().split()))\n\tmax_area = -1\n\tif y * a > max_area:\n\t\tmax_area = y * a\n\tif (a - x - 1) * b > max_area:\n\t\tmax_area = (a - x - 1) * b\n\tif x * b > max_area:\n\t\tmax_area = x * b\n\tif (b - y - 1) * a > max_area:\n\t\tmax_area = (b - y - 1) * a\n\tprint(max_area)\n", "t = int(input())\ni = int(0)\nfor i in range(t):\n\t(a, b, x, y) = map(int, input().split())\n\tmx1 = max(a * y, b * x)\n\tmx2 = max((a - 1 - x) * b, (b - 1 - y) * a)\n\tprint(max(mx1, mx2))\n", "t = int(input())\nwhile t != 0:\n\t(a, b, x, y) = map(int, input().split())\n\tp1 = y * a\n\tp2 = x * b\n\tp3 = (b - y - 1) * a\n\tp4 = (a - x - 1) * b\n\tprint(max(p1, p2, p3, p4))\n\tt = t - 1\n", "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools\ninf = 10 ** 20\neps = 1.0 / 10 ** 10\nmod = 10 ** 9 + 7\nmod2 = 998244353\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\ndef LI():\n\treturn list(map(int, sys.stdin.readline().split()))\n\ndef LLI():\n\treturn [list(map(int, l.split())) for l in sys.stdin.readlines()]\n\ndef LI_():\n\treturn [int(x) - 1 for x in sys.stdin.readline().split()]\n\ndef LF():\n\treturn [float(x) for x in sys.stdin.readline().split()]\n\ndef LS():\n\treturn sys.stdin.readline().split()\n\ndef I():\n\treturn int(sys.stdin.readline())\n\ndef F():\n\treturn float(sys.stdin.readline())\n\ndef S():\n\treturn input()\n\ndef pf(s):\n\treturn print(s, flush=True)\n\ndef pe(s):\n\treturn print(str(s), file=sys.stderr)\n\ndef JA(a, sep):\n\treturn sep.join(map(str, a))\n\ndef JAA(a, s, t):\n\treturn s.join((t.join(map(str, b)) for b in a))\n\ndef IF(c, t, f):\n\treturn t if c else f\n\ndef YES(c):\n\treturn IF(c, 'YES', 'NO')\n\ndef Yes(c):\n\treturn IF(c, 'Yes', 'No')\n\ndef main():\n\tt = I()\n\trr = []\n\tfor _ in range(t):\n\t\t(a, b, x, y) = LI()\n\t\tr = max(a * max(y, b - y - 1), b * max(x, a - x - 1))\n\t\trr.append(r)\n\treturn JA(rr, '\\n')\nprint(main())\n", "from __future__ import division, print_function\nfrom fractions import Fraction\nimport sys\nimport os\nfrom io import BytesIO, IOBase\nfrom functools import cmp_to_key\nfrom heapq import *\nfrom math import gcd, factorial, floor, ceil\nfrom copy import deepcopy\nfrom collections import deque\nfrom bisect import bisect_left as bl\nfrom bisect import bisect_right as br\nfrom bisect import bisect\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n\ndef print(*args, **kwargs):\n\t(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))\n\tat_start = True\n\tfor x in args:\n\t\tif not at_start:\n\t\t\tfile.write(sep)\n\t\tfile.write(str(x))\n\t\tat_start = False\n\tfile.write(kwargs.pop('end', '\\n'))\n\tif kwargs.pop('flush', False):\n\t\tfile.flush()\nif sys.version_info[0] < 3:\n\t(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))\nelse:\n\t(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\nfrom types import GeneratorType\n\ndef iterative(f, stack=[]):\n\n\tdef wrapped_func(*args, **kwargs):\n\t\tif stack:\n\t\t\treturn f(*args, **kwargs)\n\t\tto = f(*args, **kwargs)\n\t\twhile True:\n\t\t\tif type(to) is GeneratorType:\n\t\t\t\tstack.append(to)\n\t\t\t\tto = next(to)\n\t\t\t\tcontinue\n\t\t\tstack.pop()\n\t\t\tif not stack:\n\t\t\t\tbreak\n\t\t\tto = stack[-1].send(to)\n\t\treturn to\n\treturn wrapped_func\n\ndef inp():\n\treturn sys.stdin.readline().rstrip('\\r\\n')\n\ndef out(var):\n\tsys.stdout.write(str(var))\n\ndef lis():\n\treturn list(map(int, inp().split()))\n\ndef stringlis():\n\treturn list(map(str, inp().split()))\n\ndef sep():\n\treturn map(int, inp().split())\n\ndef strsep():\n\treturn map(str, inp().split())\n\ndef zerolist(n):\n\treturn [0] * n\n\ndef nextline():\n\tout('\\n')\n\ndef testcase(t):\n\tfor pp in range(t):\n\t\tsolve(pp)\n\ndef printlist(a):\n\tfor p in range(0, len(a)):\n\t\tout(str(a[p]) + ' ')\n\ndef google(p):\n\tprint('Case #' + str(p) + ': ', end='')\n\ndef lcm(a, b):\n\treturn a * b // gcd(a, b)\n\ndef power(x, y, p):\n\tres = 1\n\tx = x % p\n\tif x == 0:\n\t\treturn 0\n\twhile y > 0:\n\t\tif y & 1 == 1:\n\t\t\tres = res * x % p\n\t\ty = y >> 1\n\t\tx = x * x % p\n\treturn res\n\ndef ncr(n, r):\n\treturn factorial(n) // (factorial(r) * factorial(max(n - r, 1)))\n\ndef isPrime(n):\n\tif n <= 1:\n\t\treturn False\n\tif n <= 3:\n\t\treturn True\n\tif n % 2 == 0 or n % 3 == 0:\n\t\treturn False\n\ti = 5\n\twhile i * i <= n:\n\t\tif n % i == 0 or n % (i + 2) == 0:\n\t\t\treturn False\n\t\ti = i + 6\n\treturn True\ninf = pow(10, 20)\nmod = 10 ** 9 + 7\n\ndef solve(case):\n\t(a, b, x, y) = sep()\n\tprint(max(b * x, b * (a - x - 1), a * y, a * (b - y - 1)))\ntestcase(int(inp()))\n"]

difficulty: EASY

source: codeforces

raw_problem:
A. Dead Pixel

time limit per test
1 second

memory limit per test
256 megabytes

input
standard input

output
standard output

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.

question:
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](1.png)

data_split: test