You are given four integers $a$, $b$, $x$ and $y$. Initially, $a \ge x$ and $b \ge y$. You can do the following operation no more than $n$ times:

  Choose either $a$ or $b$ and decrease it by one. However, as a result of this operation, value of $a$ cannot become less than $x$, and value of $b$ cannot become less than $y$. 

Your task is to find the minimum possible product of $a$ and $b$ ($a \cdot b$) you can achieve by applying the given operation no more than $n$ times.

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 2 \cdot 10^4$) — the number of test cases. Then $t$ test cases follow.

The only line of the test case contains five integers $a$, $b$, $x$, $y$ and $n$ ($1 \le a, b, x, y, n \le 10^9$). Additional constraint on the input: $a \ge x$ and $b \ge y$ always holds.


-----Output-----

For each test case, print one integer: the minimum possible product of $a$ and $b$ ($a \cdot b$) you can achieve by applying the given operation no more than $n$ times.


-----Example-----
Input
7
10 10 8 5 3
12 8 8 7 2
12343 43 4543 39 123212
1000000000 1000000000 1 1 1
1000000000 1000000000 1 1 1000000000
10 11 2 1 5
10 11 9 1 10

Output
70
77
177177
999999999000000000
999999999
55
10



-----Note-----

In the first test case of the example, you need to decrease $b$ three times and obtain $10 \cdot 7 = 70$.

In the second test case of the example, you need to decrease $a$ one time, $b$ one time and obtain $11 \cdot 7 = 77$.

In the sixth test case of the example, you need to decrease $a$ five times and obtain $5 \cdot 11 = 55$.

In the seventh test case of the example, you need to decrease $b$ ten times and obtain $10 \cdot 1 = 10$.

Difficulty: EASY
Tags: Complete search

Mathematics

Greedy algorithms
Skill types: Complete search

Greedy algorithms

Starter code:

Solutions:
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	nn = n
	if a - x >= n:
		r1 = (a - n) * b
	else:
		n = n - (a - x)
		if b - y >= n:
			r1 = x * (b - n)
		else:
			r1 = x * y
	n = nn
	if b - y >= n:
		r2 = (b - n) * a
	else:
		n = n - (b - y)
		if a - x >= n:
			r2 = y * (a - n)
		else:
			r2 = x * y
	z = min(r1, r2)
	print(z)


t = int(input())

def check(a, b, x, y, n):
	can = min(a - x, n)
	a -= can
	n -= can
	can = min(b - y, n)
	b -= can
	return a * b
for i in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	print(min(check(a, b, x, y, n), check(b, a, y, x, n)))


def run_case():
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) >= n:
		t = []
		temp = a - x
		if temp >= n:
			t.append((a - n) * b)
		else:
			t.append(x * (b - (n - temp)))
		temp = b - y
		if temp >= n:
			t.append((b - n) * a)
		else:
			t.append(y * (a - (n - temp)))
		print(min(t))
	else:
		print(x * y)
flag = 1
if flag:
	t = int(input())
	for i in range(t):
		run_case()
else:
	run_case()


import math
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	ans = 0
	if n >= a - x + b - y:
		ans = x * y
	elif a - x >= n:
		ans = (a - n) * b
	else:
		ans = x * (b - (n - (a - x)))
	(a, b) = (b, a)
	(x, y) = (y, x)
	ans1 = 0
	if n >= a - x + b - y:
		ans1 = x * y
	elif a - x >= n:
		ans1 = (a - n) * b
	else:
		ans1 = x * (b - (n - (a - x)))
	print(min(ans, ans1))


from functools import lru_cache
from sys import stdin, stdout
import sys
from math import *
for __ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		a1 = a
		b1 = b
		n1 = n
		if n1 > a1 - x:
			n1 -= a1 - x
			a1 = x
		else:
			a1 -= n1
			n1 = 0
		if n1 > b1 - y:
			n1 -= b1 - y
			b1 = y
		else:
			b1 -= n1
			n1 = 0
		ans1 = a1 * b1
		a1 = a
		b1 = b
		n1 = n
		if n1 > b1 - y:
			n1 -= b1 - y
			b1 = y
		else:
			b1 -= n1
			n1 = 0
		if n1 > a1 - x:
			n1 -= a1 - x
			a1 = x
		else:
			a1 -= n1
			n1 = 0
		ans2 = a1 * b1
		print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a + b - x - y < n:
		print(x * y)
	else:
		minProduct = 10 ** 20
		if a - n >= x:
			product = (a - n) * b
			if product < minProduct:
				minProduct = product
		else:
			product = x * max(y, b - n + a - x)
			if product < minProduct:
				minProduct = product
		if b - n >= y:
			product = (b - n) * a
			if product < minProduct:
				minProduct = product
		else:
			product = y * max(x, a - n + b - y)
			if product < minProduct:
				minProduct = product
		print(minProduct)


def get(a, b, x, y, n):
	N = min(a - x, n)
	a -= N
	n -= N
	N = min(b - y, n)
	b -= N
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	f = get(a, b, x, y, n)
	(a, b) = (b, a)
	(x, y) = (y, x)
	s = get(a, b, x, y, n)
	print(min(f, s))


from math import *
from bisect import *
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
for _ in range(I()):
	(a, b, x, y, n) = M()
	c = a - x
	d = b - y
	(e, f, m) = (a, b, n)
	if b > a:
		g = min(c, n)
		a -= g
		n -= g
		g = min(d, n)
		b -= g
		n -= g
	else:
		g = min(d, n)
		b -= g
		n -= g
		g = min(c, n)
		a -= g
		n -= g
	if c > d:
		g = min(c, m)
		e -= g
		m -= g
		g = min(m, d)
		f -= g
		m -= g
	else:
		g = min(m, d)
		f -= g
		m -= g
		g = min(c, m)
		e -= g
		m -= g
	print(min(a * b, e * f))


for _ in range(int(input())):
	[a, b, x, y, n] = list(map(int, input().split()))
	if a - x + b - y <= n:
		print(x * y)
	else:
		if x <= y:
			if a - x <= n:
				n -= a - x
				a = x
				if b - y <= n:
					b = y
				else:
					b -= n
			elif a <= b:
				a -= n
			elif b - y >= n:
				b -= n
			else:
				if a - y > n:
					n -= b - y
					b = y
				a -= n
		elif b - y <= n:
			n -= b - y
			b = y
			if a - x <= n:
				a = x
			else:
				a -= n
		elif b <= a:
			b -= n
		elif a - x >= n:
			a -= n
		else:
			if b - x > n:
				n -= a - x
				a = x
			b -= n
		print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a == b:
		if True:
			z = max(y, b - n)
			n1 = n - (b - z)
			z1 = max(x, a - n1)
			k1 = z1 * z
		if True:
			z = max(x, a - n)
			n1 = n - (a - z)
			z1 = max(y, b - n1)
			k2 = z1 * z
		print(min(k1, k2))
	else:
		if True:
			z = max(x, a - n)
			n1 = n - (a - z)
			z1 = max(y, b - n1)
			k1 = z1 * z
		if True:
			z = max(y, b - n)
			n1 = n - (b - z)
			z1 = max(x, a - n1)
			k2 = z1 * z
		print(min(k1, k2))


for j in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	temp1 = n
	tempa = a
	tempb = b
	diff = tempa - x
	v0 = min(diff, temp1)
	temp1 -= v0
	tempa -= v0
	diff2 = tempb - y
	v1 = min(diff2, temp1)
	temp1 -= v1
	tempb -= v1
	prod = tempa * tempb
	temp2 = n
	tempa2 = a
	tempb2 = b
	diff3 = tempb2 - y
	v2 = min(diff3, temp2)
	temp2 -= v2
	tempb2 -= v2
	diff4 = tempa2 - x
	v3 = min(diff4, temp2)
	temp2 -= v3
	tempa2 -= v3
	prod1 = tempa2 * tempb2
	print(min(prod1, prod))


from sys import stdin, stdout

def find2(A, B, X, Y, N):
	(H, J) = (A - X, B - Y)
	L = min([H, N])
	H -= L
	N -= L
	L = min([J, N])
	J -= L
	N -= L
	return (X + H) * (Y + J)

def find(A, B, X, Y, N):
	return min(find2(A, B, X, Y, N), find2(B, A, Y, X, N))

def main():
	for _ in range(int(stdin.readline())):
		(A, B, X, Y, N) = list(map(int, stdin.readline().split()))
		print(find(A, B, X, Y, N))
main()


def min_pro(a, b, x, y, n):
	if max(a - n, x) < max(b - n, y):
		anm = max(a - n, x)
		n = n - (a - anm)
		bnm = max(b - n, y)
		return anm * bnm
	else:
		bnm = max(b - n, y)
		n = n - (b - bnm)
		anm = max(a - n, x)
		return anm * bnm
t = int(input())
for i in range(t):
	(a, b, x, y, n) = input().split()
	print(min_pro(int(a), int(b), int(x), int(y), int(n)))


for iii in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a == x and b == y:
		print(a * b)
	else:
		opa = a - x
		opb = b - y
		if opa >= n and opb >= n:
			print(min([(a - n) * b, (b - n) * a]))
		elif opa >= n:
			l = []
			l.append((a - n) * b)
			t = n - opb
			l.append((b - opb) * (a - t))
			print(min(l))
		elif opb >= n:
			l = []
			l.append((b - n) * a)
			t = n - opa
			l.append((a - opa) * (b - t))
			print(min(l))
		else:
			l = []
			t = n - opa
			if t >= opb:
				l.append((a - opa) * (b - opb))
			else:
				l.append((a - opa) * (b - t))
			t = n - opb
			if t >= opa:
				l.append((a - opa) * (b - opb))
			else:
				l.append((a - t) * (b - opb))
			print(min(l))


t = int(input())
for i in range(0, t):
	(a, b, c, d, e) = map(int, input().split())
	y = min(a, b)
	z = max(a, b)
	if y == a:
		k = c
		l = d
	else:
		k = d
		l = c
	diff1 = max(y - e, k)
	diff2 = max(z - e, l)
	diff3 = min(diff1, diff2)
	if diff3 == diff2:
		cons = e - (z - diff2)
		le = max(y - cons, k)
		prod = le * diff3
	else:
		cons = e - (y - diff1)
		le = max(z - cons, l)
		prod = le * diff3
	print(prod)


import math

def solve():
	(a, b, x, y, n) = map(int, input().split())
	(c, d, p, q, k) = (a, b, x, y, n)
	if x <= y:
		if a - x >= n:
			a -= n
			n = 0
		else:
			n -= a - x
			a = x
		if b - y >= n:
			b -= n
			n = 0
		else:
			n -= b - y
			b = y
	else:
		if b - y >= n:
			b -= n
			n = 0
		else:
			n -= b - y
			b = y
		if a - x >= n:
			a -= n
			n = 0
		else:
			n -= a - x
			a = x
	if c <= d:
		if c - p >= k:
			c -= k
			k = 0
		else:
			k -= c - p
			c = p
		if d - q >= k:
			d -= k
			k = 0
		else:
			k -= d - q
			d = q
	else:
		if d - q >= k:
			d -= k
			k = 0
		else:
			k -= d - q
			d = q
		if c - p >= k:
			c -= k
			k = 0
		else:
			k -= c - p
			c = p
	print(min(a * b, c * d))
for test in range(int(input())):
	solve()


from sys import stdin
import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, stdin.readline().rstrip().split(' '))
	c1 = c2 = n
	if n > a - x:
		c1 = c1 - (a - x)
		r1 = (a - (n - c1)) * max(y, b - c1)
	else:
		r1 = (a - c1) * b
	if n > b - y:
		c2 = c2 - (b - y)
		r2 = (b - (n - c2)) * max(x, a - c2)
	else:
		r2 = (b - c2) * a
	print(min(r1, r2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	acopy = a
	bcopy = b
	diffby = b - y
	diffax = a - x
	if n > diffby:
		b = b - diffby
	else:
		b = b - n
	if n > diffax:
		a = a - diffax
	else:
		a = a - n
	if a < b:
		nrb = n - (acopy - a)
		b = bcopy - nrb
		if b < y:
			b = y
	else:
		nra = n - (bcopy - b)
		a = acopy - nra
		if a < x:
			a = x
	print(a * b)


t = int(input())
while t > 0:
	(a, b, x, y, n) = [int(x) for x in input().split()]

	def func(a, b, x, y, n):
		(a1, b1, x1, y1, n1) = (a, b, x, y, n)
		if a1 - n1 >= x1:
			a1 = a1 - n1
			n1 = 0
		else:
			a1 = x1
			n1 = n1 - a + x
		if n1 > 0:
			if b1 - n1 >= y1:
				b1 = b1 - n1
				n1 = 0
			else:
				b1 = y1
		ans = a1 * b1
		return ans
	print(min(func(a, b, x, y, n), func(b, a, y, x, n)))
	t -= 1


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	n1 = n
	if a1 - x <= n1:
		n1 -= a1 - x
		a1 = x
		if b1 - n1 >= y:
			b1 = b1 - n1
		else:
			b1 = y
	else:
		a1 = a1 - n1
	a2 = a
	b2 = b
	if b2 - y <= n:
		n -= b2 - y
		b2 = y
		if a2 - n >= x:
			a2 = a2 - n
		else:
			a2 = x
	else:
		b2 = b2 - n
	print(min(a1 * b1, a2 * b2))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7
mod2 = 998244353

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

def out(var):
	sys.stdout.write(str(var) + '\n')

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

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

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

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

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

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

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

def calc(a, b, x, y, n):
	diff = a - x
	if n >= diff:
		a = x
		n -= diff
	else:
		a -= n
		n = 0
	if diff:
		b = max(b - n, y)
	return a * b
for _ in range(int(data())):
	(aa, bb, xx, yy, nn) = sp()
	out(min(calc(aa, bb, xx, yy, nn), calc(bb, aa, yy, xx, nn)))


import math
t = int(input())
for i in range(t):
	(a1, b1, x1, y1, n1) = map(int, input().split())
	a = a1
	b = b1
	x = x1
	y = y1
	n = n1
	if a - x < n:
		n -= a - x
		a = x
		if b - y < n:
			b = y
			ans = a * b
		else:
			b -= n
			ans = a * b
	else:
		a -= n
		ans = a * b
	b = a1
	a = b1
	y = x1
	x = y1
	n = n1
	if a - x < n:
		n -= a - x
		a = x
		if b - y < n:
			b = y
			ans = min(a * b, ans)
		else:
			b -= n
			ans = min(a * b, ans)
	else:
		a -= n
		ans = min(a * b, ans)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(a1, b1, n1) = (a, b, n)
	if a1 - n1 >= x:
		a1 -= n1
	else:
		n1 -= a1 - x
		a1 = x
		if b1 - n1 > y:
			b1 -= n1
		else:
			b1 = y
	poss1 = a1 * b1
	(a2, b2, n2) = (a, b, n)
	if b2 - n2 >= y:
		b2 -= n2
	else:
		n2 -= b2 - y
		b2 = y
		if a2 - n2 > x:
			a2 -= n2
		else:
			a2 = x
	poss2 = a2 * b2
	mult = poss1 if poss1 < poss2 else poss2
	print(mult)


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

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

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write('\n'.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
mod = int(1000000000.0) + 7
INF = 2 ** 32
for t in range(int(data())):
	(a, b, x, y, n) = mdata()
	m1 = max(a - n, x)
	m2 = max(b - n, y)
	if m1 < m2:
		m2 = max(b - (n - (a - m1)), y)
	else:
		m1 = max(a - (n - (b - m2)), x)
	out(m1 * m2)


import sys
input = sys.stdin.readline

def func(a, b, x, y, n):
	t = min(a - x, n)
	a -= t
	n -= t
	t = min(b - y, n)
	b -= t
	return a * b

def solve():
	(a, b, x, y, n) = map(int, input().split())
	print(min(func(a, b, x, y, n), func(b, a, y, x, n)))
for _ in range(int(input())):
	solve()


TC = int(input())
for tc in range(TC):
	(A, B, X, Y, N) = map(int, input().split())
	A1 = max(A - N, X)
	A2 = A
	result = min(A1 * max(Y, B - (N - A + A1)), A2 * max(Y, B - (N - A + A2)))
	B1 = max(B - N, Y)
	B2 = B
	result = min(result, max(X, A - (N - B + B1)) * B1, max(X, A - (N - B + B2)) * B2)
	print(result)


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	m = n
	aa = min(a - x, m)
	m -= aa
	bb = min(b - y, m)
	s1 = (a - aa) * (b - bb)
	m = n
	bb = min(b - y, m)
	m -= bb
	aa = min(a - x, m)
	s2 = (a - aa) * (b - bb)
	print(min(s1, s2))


import sys
input = lambda : sys.stdin.readline().rstrip()
from math import ceil
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = min(max(a - n, x), max(b - n, y))
	if ans == x:
		print(ans * max(y, b - (n - a + x)))
	elif ans == y:
		print(ans * max(x, a - (n - b + y)))
	elif ans == b - n:
		print(ans * a)
	else:
		print(ans * b)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = [int(j) for j in input().split(' ')]
	p = max(a - n, x)
	q = max(b - n, y)
	if p <= q:
		f = max(x, a - n)
		g = max(y, b - n + a - f)
	else:
		f = max(y, b - n)
		g = max(x, a - n + b - f)
	ans = f * g
	print(ans)


t = int(input())
i = 0
while i < t:
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1) = (a, b)
	if a - x >= n:
		a -= n
	else:
		dif = a - x
		a -= dif
		if n - dif > b - y:
			b = y
		else:
			b -= n - dif
	if b1 - y >= n:
		b1 -= n
	else:
		dif = b1 - y
		b1 -= dif
		if n - dif > a1 - x:
			a1 = x
		else:
			a1 -= n - dif
	print(min(a * b, a1 * b1))
	i += 1


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
for _ in range(ii()):
	(a, b, x, y, n) = mi()
	w = a
	s = b
	z = n
	q = a - x
	if q <= n:
		a -= q
		n -= q
	else:
		a -= n
		n = 0
	q = b - y
	if q <= n:
		b -= q
		n -= q
	else:
		b -= n
		n = 0
	sol = a * b
	n = z
	a = w
	b = s
	q = b - y
	if q <= n:
		b -= q
		n -= q
	else:
		b -= n
		n = 0
	q = a - x
	if q <= n:
		a -= q
		n -= q
	else:
		a -= n
		n = 0
	ans = a * b
	print(min(sol, ans))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c = a - x
	d = b - y
	if n > c + d:
		n = c + d
	m = 0
	p = 0
	if n <= min(c, d):
		ans = min((a - n) * b, (b - n) * a)
	elif n > min(c, d) and n < max(c, d):
		if c <= d:
			m = c
			p = n - c
			ans = min((a - m) * (b - p), a * (b - n))
		else:
			p = d
			m = n - d
			ans = min((a - m) * (b - p), (a - n) * b)
	elif n <= c + d:
		ans = min((a - c) * (b - (n - c)), (a - (n - d)) * (b - d))
	print(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	v1 = a - x
	v2 = b - y
	if v1 + v2 <= n:
		print(x * y)
		continue
	if x < y:
		if a - x <= n:
			n -= a - x
			a = x
			b -= n
			if b < y:
				b = y
			print(a * b)
			continue
	if y < x:
		if b - y <= n:
			n -= b - y
			b = y
			if n != 0:
				a -= n
				if a < x:
					a = x
			print(a * b)
			continue
	(c, d) = (a, b)
	new_n = n
	f = a
	a -= n
	if a < x:
		a = x
		n -= f - x
		if n != 0:
			b -= n
			if b < y:
				b = y
	val1 = a * b
	g = d
	d -= new_n
	if d < y:
		d = y
		new_n -= g - y
		if new_n != 0:
			c -= new_n
			if c < x:
				c = x
	val2 = c * d
	print(min(val1, val2))


def swap(a, b):
	a = a + b
	b = a - b
	a = a - b
	return (a, b)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	ans = 10 ** 18
	for __ in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b) = swap(a, b)
		(x, y) = swap(x, y)
	print(ans)


def solve(a, b, x, y, n):
	c = max(a - n, x)
	d = max(b - (n - (a - c)), y)
	return c * d
for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = max(x, a - n)
	n1 = n - (a - a1)
	b1 = max(y, b - n1)
	b2 = max(y, b - n)
	n2 = n - (b - b2)
	a2 = max(x, a - n2)
	print(min(a1 * b1, a2 * b2))


t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	ans = int(1e+18)
	for i in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


q = int(input())
for _ in range(q):
	[a, b, x, y, n] = list(map(int, input().split()))
	a1 = int(a)
	b1 = int(b)
	x1 = int(x)
	y1 = int(y)
	n1 = int(n)
	c1 = min(b1 - y1, n1)
	b1 -= c1
	n1 -= c1
	a1 -= min(a1 - x1, n1)
	ans = int(a1 * b1)
	c = min(a - x, n)
	a -= c
	n -= c
	b -= min(b - y, n)
	ans = min(ans, a * b)
	print(ans)


import math
t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	k = (a - min(a - x, n)) * (b - min(b - y, n - min(a - x, n)))
	l = (b - min(b - y, n)) * (a - min(a - x, n - min(b - y, n)))
	print(min(k, l))
	t -= 1


import sys, math, bisect
from collections import Counter, defaultdict as dd

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

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

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

def strl():
	return list(strsp())

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

def strsp():
	return map(str, data().split())
for _ in range(int(data())):
	(a, b, x, y, n) = sp()
	(a1, b1) = (a - x, b - y)
	c = (a - min(a1, n)) * (b - min(b1, n - min(a1, n)))
	d = (b - min(b1, n)) * (a - min(a1, n - min(b1, n)))
	print(min(c, d))


def algo(a, b, x, y, n):
	c = a - x
	d = b - y
	n1 = n - c
	if n1 < 0:
		a = a - n
	else:
		a = x
		n = n - c
		if d > n:
			b = b - n
		else:
			b = y
	ans = a * b
	return ans
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c = a - x
	d = b - y
	if n >= c + d:
		print(x * y)
	else:
		ans = algo(a, b, x, y, n)
		ans1 = algo(b, a, y, x, n)
		print(min(ans, ans1))


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = [int(x) for x in input().split(' ')]
	diffa = min(a - x, n)
	diffb = min(b - y, n)
	if a - diffa < b - diffb:
		a -= diffa
		diffb = min(b - y, n - diffa)
		b -= diffb
	else:
		b -= diffb
		diffa = min(a - x, n - diffb)
		a -= diffa
	print(a * b)


t = int(input())
list_ans = []
for i in range(t):
	(x, y, a, b, n) = map(int, input().split())
	if n >= x + y - a - b:
		list_ans.append(a * b)
	elif n <= x - a and n <= y - b:
		list_ans.append(min((x - n) * y, x * (y - n)))
	elif n >= x - a and n >= y - b:
		list_ans.append(min(a * (y - n + x - a), (x - n + y - b) * b))
	elif n >= x - a:
		list_ans.append(min(a * (y - n + x - a), x * (y - n)))
	else:
		list_ans.append(min((x - n) * y, (x - n + y - b) * b))
for item in list_ans:
	print(item)


for g in [*open(0)][1:]:
	(a, b, x, y, n) = map(int, g.split())
	c1 = max(x, a - n)
	c2 = max(y, b - n)
	if c1 < c2:
		print(c1 * max(b - n + a - c1, y))
	else:
		print(c2 * max(a - n + b - c2, x))


import sys
input = sys.stdin.readline

def fmin(a, b, x, y, n):
	v = max(a - n, x)
	val = n - (a - v)
	v1 = max(b - val, y)
	return v * v1
T = int(input())
for _ in range(T):
	(a, b, x, y, n) = list(map(int, input().split()))
	v = min(fmin(a, b, x, y, n), fmin(b, a, y, x, n))
	print(v)


import sys
input = sys.stdin.readline

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

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

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

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

def solve(a, b, x, y, n):
	if max(a - n, x) > max(b - n, y):
		(b, a) = (a, b)
		(x, y) = (y, x)
	decrease = min(a - x, n)
	return (a - decrease) * max(b - (n - decrease), y)
lines = inp()
for i in range(lines):
	v = inlt()
	print(solve(*v))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a >= b:
		if a == b:
			t = n
			aa = 0
			bb = 0
			if x >= y:
				if b - n >= y:
					aa = (b - n) * a
				else:
					n = n - (b - y)
					if a - n >= x:
						aa = y * (a - n)
					else:
						aa = x * y
				if a - t >= x:
					bb = (a - t) * b
				else:
					t = t - (a - x)
					if b - t >= y:
						bb = x * (b - t)
					else:
						bb = x * y
				print(min(aa, bb))
			else:
				if a - n >= x:
					aa = (a - n) * b
				else:
					n = n - (a - x)
					if b - n >= y:
						aa = x * (b - n)
					else:
						aa = x * y
				if b - t >= y:
					bb = (b - t) * a
				else:
					t = t - (b - y)
					if a - t >= x:
						bb = y * (a - t)
					else:
						bb = x * y
				print(min(aa, bb))
		else:
			t = n
			aa = 0
			bb = 0
			if b - n >= y:
				bb = (b - n) * a
			else:
				n = n - (b - y)
				if a - n >= x:
					bb = y * (a - n)
				else:
					bb = x * y
			if a - t >= x:
				aa = (a - t) * b
			else:
				t = t - (a - x)
				if b - t >= y:
					aa = x * (b - t)
				else:
					aa = x * y
			print(min(aa, bb))
	else:
		t = n
		a_x = 0
		b_y = 0
		if a - n >= x:
			a_x = b * (a - n)
		else:
			n = n - (a - x)
			if b - n >= y:
				a_x = (b - n) * x
			else:
				a_x = x * y
		if b - t >= y:
			b_y = a * (b - t)
		else:
			t = t - (b - y)
			if a - t >= x:
				b_y = (a - t) * y
			else:
				b_y = x * y
		print(min(a_x, b_y))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if max(a - n, x) > max(b - n, y):
		(a, b) = (b, a)
		(x, y) = (y, x)
	diff = min(n, a - x)
	a -= diff
	n = max(n - diff, 0)
	b = max(y, b - n)
	print(a * b)


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


t = int(input())
for _ in range(t):
	ans = 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
	(a, b, x, y, n) = list(map(int, input().split()))
	for _ in range(2):
		pa = min(n, a - x)
		pb = min(n - pa, b - y)
		ans = min(ans, (a - pa) * (b - pb))
		temp = a
		a = b
		b = temp
		temp = x
		x = y
		y = temp
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = ans2 = 1
	diff1 = a - x
	diff2 = b - y
	m = n
	(c, d) = (a, b)
	a -= min(diff1, m)
	m -= min(diff1, m)
	b -= min(diff2, m)
	ans1 = a * b
	d -= min(diff2, n)
	n -= min(diff2, n)
	c -= min(diff1, n)
	ans2 = c * d
	print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	adiff = a - x
	bdiff = b - y
	l = []
	if bdiff < n:
		nt = n
		fb = b - bdiff
		nt -= bdiff
		if adiff < nt:
			fa = a - adiff
			nt -= adiff
		else:
			fa = a - nt
			nt = 0
		l.append(fa * fb)
	else:
		nt = n
		fb = b - nt
		fa = a
		nt = 0
		l.append(fa * fb)
	adiff = a - x
	bdiff = b - y
	if adiff < n:
		nt = n
		fa = a - adiff
		nt -= adiff
		if bdiff < nt:
			fb = b - bdiff
			nt -= bdiff
		else:
			fb = b - nt
			nt = 0
		l.append(fa * fb)
	else:
		nt = n
		fa = a - nt
		fb = b
		nt = 0
		l.append(fa * fb)
	print(min(l))


from collections import defaultdict as dd
from sys import stdin, stdout
from math import log
for t in range(int(input())):
	(a, b, x, y, n) = map(int, stdin.readline().strip().split())
	if max(a - n, x) > max(b - n, y):
		(a, b, x, y) = (b, a, y, x)
	a2 = a
	if n > a - x:
		a = x
		n -= a2 - x
	else:
		a -= n
		n = 0
	b = max(b - n, y)
	stdout.write(str(a * b) + '\n')


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	temp1 = a
	temp2 = b
	if x < y:
		if a - n < x:
			temp = a
			a = x
			n -= abs(temp - x)
			if b - n < y:
				b = y
			else:
				b -= n
		else:
			a -= n
	elif b - n < y:
		temp = b
		b = y
		n -= abs(temp - y)
		if a - n < x:
			a = x
		else:
			a -= n
	else:
		b -= n
	first = a * b
	a = temp1
	b = temp2
	if a < b:
		if a - n < x:
			temp = a
			a = x
			n -= abs(temp - x)
			if b - n < y:
				b = y
			else:
				b -= n
		else:
			a -= n
	elif b - n < y:
		temp = b
		b = y
		n -= abs(temp - y)
		if a - n < x:
			a = x
		else:
			a -= n
	else:
		b -= n
	second = a * b
	print(min(first, second))


import sys, collections
input = sys.stdin.readline
n = int(input())
for _ in range(n):
	(a, b, x, y, n) = map(int, input().split())
	if a - min(a - x, n) < b - min(b - y, n):
		(a, b) = (b, a)
		(x, y) = (y, x)
	i = min(n, b - y)
	b -= i
	n -= i
	if n == 0:
		print(a * b)
		continue
	j = min(n, a - x)
	a -= j
	print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if a - x < n:
		ans1 = max(x * y, x * (b - n + a - x))
	else:
		ans1 = (a - n) * b
	if b1 - y < n1:
		ans2 = max(y * x, y * (a1 - n1 + b1 - y))
	else:
		ans2 = (b1 - n) * a1
	print(min(ans1, ans2))


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split(' '))
	ka = min([a - x, n])
	kan = n - ka
	kb = min([b - y, kan])
	ans1 = (a - ka) * (b - kb)
	kb = min([b - y, n])
	kbn = n - kb
	ka = min([a - x, kbn])
	ans2 = (a - ka) * (b - kb)
	print(min([ans1, ans2]))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a - x + (b - y) < n:
		print(x * y)
		continue
	res = []
	if a - n >= x:
		res.append((a - n) * b)
	else:
		leftover = n - (a - x)
		res.append(x * (b - leftover))
	if b - n >= y:
		res.append(a * (b - n))
	else:
		leftover = n - (b - y)
		res.append((a - leftover) * y)
	print(min(res))


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

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

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

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

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

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

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

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

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

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

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

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

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

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True

def main():
	for i in range(ii()):
		(a, b, x, y, n) = mi()
		ans = 100000000000000000000000
		if a > b:
			(a, b) = (b, a)
			(x, y) = (y, x)
		d1 = abs(a - x)
		d2 = abs(b - y)
		if y < x and d2 > d1:
			if d2 <= n:
				n -= d2
				if n > d1:
					ans = min(ans, y * (a - d1))
				else:
					ans = min(ans, y * (a - n))
			else:
				ans = min(ans, (b - n) * a)
		if d1 <= n:
			n -= d1
			if n > d2:
				ans = min(ans, x * (b - d2))
			else:
				ans = min(ans, x * (b - n))
		else:
			ans = min(ans, b * (a - n))
		print(ans)
main()


t = int(input())
while t > 0:
	p = list(map(int, input().split()))
	a = p[0]
	b = p[1]
	x = p[2]
	y = p[3]
	n = p[4]
	ans = a * b
	for i in range(0, 2):
		x1 = min(n, a - x)
		y1 = min(n - x1, b - y)
		a1 = a - x1
		b1 = b - y1
		ans = min(ans, a1 * b1)
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)
	t -= 1


def check(a, b, x, y, n):
	ans = []
	tn = n
	if a - x <= n:
		n = n - (a - x)
		if b - y <= n:
			ans.append(x * y)
		else:
			ans.append(x * (b - n))
	else:
		ans.append((a - n) * b)
	n = tn
	if b - y <= n:
		n = n - (b - y)
		if a - x <= n:
			ans.append(x * y)
		else:
			ans.append(y * (a - n))
	else:
		ans.append((b - n) * a)
	return min(ans)
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(check(a, b, x, y, n))


def function(a, x, b, y, n):
	if a - x >= n:
		a -= n
	else:
		n -= a - x
		a = x
		if b - y > n:
			b -= n
		else:
			b = y
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	s = function(a, x, b, y, n)
	d = function(b, y, a, x, n)
	print(min(s, d))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	n = min(a - x + b - y, n)
	t1 = (a - min(n, a - x)) * (b - max(0, n - min(n, a - x)))
	t2 = (b - min(n, b - y)) * (a - max(0, n - min(n, b - y)))
	print(min(t1, t2))


import math
t = int(input())
for w in range(t):
	(a, b, x, y, n) = (int(i) for i in input().split())
	if a >= b:
		k1 = a
		k2 = b
		k3 = x
		k4 = y
	else:
		k1 = b
		k2 = a
		k3 = y
		k4 = x
	n1 = n
	n2 = n
	k5 = k2
	n -= min(n, k2 - k4)
	k2 = max(k2 - n1, k4)
	if n == 0:
		j1 = k2 * k1
	else:
		j1 = k2 * max(k1 - n, k3)
	n2 -= min(n2, k1 - k3)
	k1 = max(k1 - n1, k3)
	if n == 0:
		j2 = k5 * k1
	else:
		j2 = k1 * max(k5 - n2, k4)
	print(min(j1, j2))


def func(a, b, x, y, n):
	d1 = a - x
	d2 = b - y
	if d1 >= n:
		return (a - n) * b
	if d1 < n:
		n = n - d1
		a = a - d1
		if d2 <= n:
			return a * (b - d2)
		elif d2 > n:
			d2 = n
			return a * (b - d2)
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	xx = func(a, b, x, y, n)
	yy = func(b, a, y, x, n)
	print(min(xx, yy))


t = int(input())
while t:
	t -= 1
	arr = list(map(int, input().split()))
	(a, b, x, y, n) = (arr[0], arr[1], arr[2], arr[3], arr[4])
	max_a = a - x
	max_b = b - y
	if max_a + max_b <= n:
		print(x * y)
	else:
		min_a = a - min(n, max_a)
		min_b = b - min(n, max_b)
		if min_a > min_b:
			b2 = min(n, max_b)
			b -= b2
			n -= b2
			a2 = min(n, max_a)
			a -= a2
			print(a * b)
		else:
			a2 = min(n, max_a)
			a -= a2
			n -= a2
			b2 = min(n, max_b)
			b -= b2
			print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	t = min(n, a - x)
	a -= t
	n -= t
	if n > 0:
		b -= min(n, b - y)
	t1 = min(n1, b1 - y1)
	b1 -= t1
	n1 -= t1
	if n1 > 0:
		a1 -= min(n1, a1 - x1)
	print(min(a1 * b1, a * b))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	n1 = n
	diff1 = a - x
	diff2 = b - y
	prod = []
	flag = 1
	new = 0
	if flag == 1:
		if n <= diff1:
			temp = a - n
			temp1 = b
			prod.append(temp * temp1)
		elif n > diff1:
			temp = x
			n -= diff1
			if n <= diff2:
				temp1 = b - n
				prod.append(temp * temp1)
			elif n > diff2:
				temp1 = y
				prod.append(temp * temp1)
	if new == 0:
		if n1 <= diff2:
			temp = b - n1
			prod.append(a * temp)
		elif n1 > diff2:
			temp = y
			n1 -= diff2
			if n1 <= diff1:
				temp1 = a - n1
				prod.append(temp * temp1)
			else:
				temp1 = x
				prod.append(temp * temp1)
	print(min(prod))


def find(a, b, x, y, n):
	val = min(a - x, n)
	a = a - val
	n -= val
	if n:
		b -= min(b - y, n)
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(find(b, a, y, x, n), find(a, b, x, y, n)))


for tc in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	N = n
	newA = max(a - n, x)
	n -= a - newA
	newB = max(b - n, y)
	best = newB * newA
	n = N
	newB = max(b - n, y)
	n -= b - newB
	newA = max(a - n, x)
	best = min(best, newB * newA)
	print(best)


for i in range(int(input())):
	(a, b, c, d, n) = map(int, input().split())
	(a1, b1, c1, d1, n1) = (a, b, c, d, n)
	if a - n >= c:
		result1 = (a - n) * b
	else:
		n = n - (a - c)
		if b - n >= d:
			result1 = c * (b - n)
		else:
			result1 = c * d
	(a1, b1) = (b1, a1)
	(c1, d1) = (d1, c1)
	if a1 - n1 >= c1:
		result2 = (a1 - n1) * b1
	else:
		n1 = n1 - (a1 - c1)
		if b1 - n1 >= d1:
			result2 = c1 * (b1 - n1)
		else:
			result2 = c1 * d1
	if result1 < result2:
		print(result1)
	else:
		print(result2)


import sys
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))

def main():
	for _ in range(int(input())):
		(a, b, x, y, n) = read()
		c = max(x, a - n)
		d = max(y, b - n)
		m = c * max(y, b - (n - (a - c)))
		p = d * max(x, a - (n - (b - d)))
		print(min(m, p))
main()


from bisect import bisect_left
import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
from collections import deque
from functools import cmp_to_key
import math
import heapq

def sin():
	return input()

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

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

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	s = set()
	for p in range(2, n + 1):
		if prime[p]:
			s.add(p)
	return s

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def main():
	for _ in range(iin()):
		(a, b, x, y, n) = ain()
		x1 = max(a - n, x)
		p = n - (a - x1)
		y1 = max(b - p, y)
		y2 = max(b - n, y)
		q = n - (b - y2)
		x2 = max(a - q, x)
		print(min(x1 * y1, x2 * y2))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if os.getcwd() == 'D:\\code':
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def ok(a, b, x, y, n):
	if b - y >= n:
		b -= n
		return a * b
	else:
		n -= b - y
		b = y
		if a - x >= n:
			a -= n
			return a * b
		else:
			a = x
			return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = min(ok(a, b, x, y, n), ok(b, a, y, x, n))
	print(ans)


import sys
input = sys.stdin.readline

def solve(a, b, x, y, n):
	if n == 0 or (a == x and b == y):
		return a * b
	a1 = solve(a - min(a - x, n), b, x, y, n - min(a - x, n)) if a - x > 0 else float('inf')
	a2 = solve(a, b - min(b - y, n), x, y, n - min(b - y, n)) if b - y > 0 else float('inf')
	return min(a1, a2)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(solve(a, b, x, y, n))


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
import threading
from collections import defaultdict
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	d1 = n
	(a1, a2, b1, b2) = (a, a, b, b)
	m = min(a1 - x, d1)
	d1 -= m
	a1 -= m
	b1 -= min(d1, b1 - y)
	m = min(b2 - y, n)
	n -= m
	b2 -= m
	a2 -= min(n, a2 - x)
	print(min(a1 * b1, a2 * b2))


t = int(input())
for you in range(t):
	l = input().split()
	a = int(l[0])
	b = int(l[1])
	x = int(l[2])
	y = int(l[3])
	n = int(l[4])
	n1 = n
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	if n < a - x:
		case1 = (a - n) * b
	else:
		n -= a - x
		a = x
		if n < b - y:
			case1 = a * (b - n)
		else:
			case1 = x * y
	if n1 < b1 - y1:
		case2 = (b1 - n1) * a1
	else:
		n1 -= b1 - y1
		b1 = y1
		if n1 < a1 - x1:
			case2 = b1 * (a1 - n1)
		else:
			case2 = x1 * y1
	print(min(case1, case2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = []
	a1 = a
	b1 = b
	n1 = n
	if 1:
		if n <= a - x:
			a = a - n
			ans.append(a * b)
		else:
			n = n - (a - x)
			a = x
			b = max(y, b - n)
			ans.append(a * b)
	a = a1
	b = b1
	n = n1
	if 1:
		if n <= b - y:
			b = b - n
			ans.append(a * b)
		else:
			n = n - (b - y)
			b = y
			a = max(x, a - n)
			ans.append(a * b)
	print(min(ans))


for ___ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	levelOne = max(x, a - n)
	levelTwo = max(y, b - n)
	if levelOne < levelTwo:
		a -= n
		if a < x:
			tmp = x - a
			a = x
			b -= tmp
			if b < y:
				b = y
		print(a * b)
	else:
		b -= n
		if b < y:
			tmp = y - b
			b = y
			a -= tmp
			if a < x:
				a = x
		print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	j = min(n, a - x)
	k = min(n, b - y)
	if a - j < b - k:
		print((a - j) * (b - min(n - j, k)))
	else:
		print((b - k) * (a - min(n - k, j)))


for t in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	res = a * b
	if a - x >= n and b - y >= n:
		print(min((a - n) * b, (b - n) * a))
	elif a - x >= n and b - y < n:
		print(min((a - n) * b, y * max(a - (n - (b - y)), x)))
	elif a - x < n and b - y >= n:
		print(min((b - n) * a, x * max(b - (n - (a - x)), y)))
	else:
		print(min(x * max(b - (n - (a - x)), y), y * max(a - (n - (b - y)), x)))


for _ in range(int(input())):
	(a, b, x, y, op) = map(int, input().split())
	op1 = a - x
	op2 = b - y
	p = a - min(op, op1)
	q = b - min(op, op2)
	if p <= q:
		a -= min(op, op1)
		op -= min(op, op1)
		if op > 0:
			b -= min(op, op2)
	else:
		b -= min(op, op2)
		op -= min(op, op2)
		if op > 0:
			a -= min(op, op1)
	print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	tmp1 = a - n if a - n >= x else x
	tmp2 = b - n if b - n >= y else y
	if tmp1 >= tmp2:
		n -= b - tmp2
		a = a - n if a - n >= x else x
		print(tmp2 * a)
	else:
		n -= a - tmp1
		b = b - n if b - n >= y else y
		print(tmp1 * b)


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

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

def read_string():
	return input()

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

def swap(x, y):
	return (y, x)

def helper(a, b, x, y, n):
	diff_a = a - x
	if diff_a >= n:
		a -= n
		return a * b
	else:
		a -= diff_a
		n -= diff_a
		b -= n
		if b < y:
			b = y
		return a * b

def solve():
	(a, b, x, y, n) = read_ints()
	sol = min(helper(a, b, x, y, n), helper(b, a, y, x, n))
	print(sol)

def read_input():
	t = read_int()
	for _ in range(t):
		solve()
read_input()


lol = int(input())
for i in range(0, lol):
	nums = input().split(' ')
	a = int(nums[0])
	b = int(nums[1])
	x = int(nums[2])
	y = int(nums[3])
	n = int(nums[4])
	a1 = max(a - n, x)
	b1 = max(b - (n - (a - a1)), y)
	b2 = max(b - n, y)
	a2 = max(a - (n - (b - b2)), x)
	print(min(a1 * b1, a2 * b2))


def find(a1, b1, x1, y1, n1):
	sub1 = a1 - x1
	sub2 = b1 - y1
	if n1 <= sub1:
		a1 -= n1
	else:
		a1 -= sub1
		n1 -= sub1
		if n1 > sub2:
			b1 -= sub2
		else:
			b1 -= n1
	return a1 * b1
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(find(b, a, y, x, n), find(a, b, x, y, n)))


def v1(a, b, x, y, n):
	curr = min(a - x, n)
	a -= curr
	n -= curr
	if n > 0:
		b -= min(n, b - y)
	return a * b

def v2(a, b, x, y, n):
	curr = min(b - y, n)
	b -= curr
	n -= curr
	if n > 0:
		a -= min(n, a - x)
	return a * b
n = int(input())
for i in range(n):
	(a, b, x, y, n) = map(int, input().split())
	q = v1(a, b, x, y, n)
	w = v2(a, b, x, y, n)
	print(min(q, w))


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	(ca, cb) = (a - x, b - y)
	possibs = []
	if ca > n:
		possibs.append((a - n) * b)
	else:
		possibs.append((a - ca) * (b - min(n - ca, cb)))
	if cb > n:
		possibs.append((b - n) * a)
	else:
		possibs.append((b - cb) * (a - min(n - cb, ca)))
	print(min(possibs))


t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	if a == x and b == y:
		print(a * b)
	else:
		c = a - x
		d = b - y
		l = []
		if c + d >= n:
			if d >= n:
				l.append(a * (b - n))
			else:
				l.append((a - (n - d)) * (b - d))
			if c >= n:
				l.append(b * (a - n))
			else:
				l.append((b - (n - c)) * (a - c))
		else:
			l.append(x * y)
		print(min(l))
	t -= 1


def main(a, b, x, y, n):
	beta2 = 999999999
	alpha2 = 99999999
	if a >= b:
		beta = b
		limb = y
		alpha = a
		lima = x
	else:
		beta = a
		limb = x
		alpha = b
		lima = y
	t = beta - n
	n2 = limb - t
	if n2 > 0:
		beta = limb
		t2 = alpha - n2
		t3 = alpha - n
		if t3 >= lima:
			alpha2 = t3
			beta2 = t + n
		if t3 < lima:
			alpha2 = lima
			beta2 = max(t + n - (lima - t3), limb)
		if t2 >= lima:
			alpha = t2
		else:
			alpha = lima
		return min(alpha * beta, alpha2 * beta2)
	beta = t
	return alpha * beta
k = int(input())
for i in range(k):
	(a, b, x, y, n) = map(int, input().split())
	print(main(a, b, x, y, n))


test = int(input())

def get(a, b, x, y, n):
	c1 = min(a - x, n)
	n -= c1
	a -= c1
	c2 = min(n, b - y)
	n -= c2
	b -= c2
	return a * b
for _ in range(test):
	ls = list(map(int, input().split()))
	n = ls[-1]
	(a, b, x, y) = (ls[0], ls[1], ls[2], ls[3])
	z = min(get(a, b, x, y, n), get(b, a, y, x, n))
	print(z)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		a1 = max(x, a - n)
		b1 = b - (n - (a - a1))
		ans = a1 * b1
		t = a
		a = b
		b = t
		t = x
		x = y
		y = t
		a1 = max(x, a - n)
		b1 = b - (n - (a - a1))
		ans = min(ans, a1 * b1)
		print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = (int(x) for x in input().split())
	c = a
	d = b
	m = n
	m_ = m
	m -= min(m_, c - x)
	c -= min(m_, c - x)
	m_ = m
	m -= min(m_, d - y)
	d -= min(m_, d - y)
	p = c * d
	n_ = n
	n -= min(n_, b - y)
	b -= min(n_, b - y)
	n_ = n
	n -= min(n_, a - x)
	a -= min(n_, a - x)
	q = a * b
	print(min(p, q))


def findmin(number, limit, n):
	if number - limit >= n:
		mini = number - n
		n = 0
	else:
		mini = limit
		n = n - (number - limit)
	return [mini, n]
t = int(input())
for i in range(t):
	(a, b, x, y, n) = [int(j) for j in input().split()]
	n1 = n
	n2 = n
	(mina1, n1) = findmin(a, x, n1)
	(minb1, n1) = findmin(b, y, n1)
	(minb2, n2) = findmin(b, y, n2)
	(mina2, n2) = findmin(a, x, n2)
	if mina1 * minb1 < mina2 * minb2:
		print(mina1 * minb1)
	else:
		print(mina2 * minb2)


t = int(input())
for hh in range(0, t):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	a_orig = a
	b_orig = b
	diff1 = a - x
	gone = min(n, diff1)
	a = a - gone
	rem = n - gone
	diff2 = b - y
	gone = min(rem, diff2)
	b = b - gone
	prod1 = a * b
	a = a_orig
	b = b_orig
	diff1 = b - y
	gone = min(n, diff1)
	b = b - gone
	rem = n - gone
	diff2 = a - x
	gone = min(rem, diff2)
	a = a - gone
	prod2 = a * b
	print(min(prod1, prod2))


from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf

def sp():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = sp()
	get_max_ans = a * b
	get_max_ans_2 = get_max_ans
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	a1 = a
	a2 = b
	a3 = n
	first_dif = b - y
	get_max_ans -= a * min(n, b - y)
	n -= b - y
	if n > 0:
		b = y
		get_max_ans -= b * min(n, a - x)
	a = a1
	b = a2
	n = a3
	get_max_ans_2 -= b * min(n, a - x)
	n -= a - x
	if n > 0:
		a = x
		get_max_ans_2 -= a * min(n, b - y)
	print(min(get_max_ans, get_max_ans_2))


try:
	for _ in range(int(input())):
		(a, b, x, y, n) = map(int, input().split())
		if y < x:
			(b, a) = (a, b)
			(y, x) = (x, y)
		if a - x <= n:
			if a - n >= x:
				a = a - n
				n = 0
			else:
				n = n - (a - x)
				a = x
			if n > 0:
				if b - n >= y:
					b = b - n
				else:
					b = y
			print(a * b)
			continue
		else:
			if a - n >= x:
				c1 = a - n
			else:
				c1 = x
			if b - n >= y:
				c2 = b - n
			else:
				c2 = y
			if c1 < c2:
				n = n - (a - c1)
				if n <= 0:
					print(c1 * b)
					continue
				else:
					if b - n >= y:
						b = b - n
					else:
						b = y
					print(c1 * b)
					continue
			else:
				n = n - (b - c2)
				if n <= 0:
					print(a * c2)
					continue
				else:
					if a - n >= x:
						a = a - n
					else:
						a = x
					print(a * c2)
					continue
except:
	pass


R = lambda : map(int, input().split())
(t,) = R()
for _ in range(t):
	(a, b, x, y, n) = R()
	ans = []
	for (q, w, e, r) in ((a, b, x, y), (b, a, y, x)):
		i = min(q - e, n)
		j = min(w - r, n - i)
		ans.append((q - i) * (w - j))
	print(min(ans))


import sys
input = sys.stdin.readline

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

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

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

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

def solve(a, b, x, y, n):
	c = min(a, b)
	d = a + b - c
	if a < b:
		u = x
		v = y
	else:
		u = y
		v = x
	c1 = c - min(n, c - u)
	n1 = n - min(c - u, n)
	d1 = d - min(n1, d - v)
	d2 = d - min(n, d - v)
	n2 = n - min(d - v, n)
	c2 = c - min(n2, c - u)
	return min(c1 * d1, c2 * d2)
N = inp()
for _ in range(N):
	(a, b, x, y, n) = invr()
	print(solve(a, b, x, y, n))


rr = lambda : input().strip()
rri = lambda : int(rr())
rrm = lambda : [int(x) for x in rr().split()]
from sys import stdin, stdout, setrecursionlimit

def sol():
	(a, b, x, y, n) = rrm()
	xa = a - x
	res = max(x, a - n) * max(y, b - max(0, n - xa))
	xb = b - y
	res = min(res, max(x, a - max(0, n - xb)) * max(y, b - n))
	print(res)
	return

def main():
	T = rri()
	for t in range(1, T + 1):
		ans = sol()
main()


def minimum(a, b, x, y, n):
	a1 = max(x, a - n)
	b1 = b - (n - (a - a1))
	return a1 * b1
t = int(input())
while t > 0:
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		min1 = minimum(a, b, x, y, n)
		min2 = minimum(b, a, y, x, n)
		if min1 > min2:
			print(min2)
		else:
			print(min1)
	t -= 1


import collections
from functools import lru_cache
import bisect
INF = float('inf')
NEG_INF = float('inf')
ZERO = 0
ONE = 1

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

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

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

def solve(a, b, x, y, n):

	def go(a, b, x, y, n):
		newA = max(x, a - n)
		n -= a - newA
		newB = max(y, b - n)
		return newA * newB
	return min(go(a, b, x, y, n), go(b, a, y, x, n))
t = readInt()
for i in range(t):
	(a, b, x, y, n) = readList()
	print(solve(a, b, x, y, n))


def check(mi, ma, n):
	diif = mi[0] - mi[1]
	if diif >= n:
		return ma[0] * (mi[0] - n)
	else:
		mi[0] = mi[1]
		n -= diif
		if ma[0] - n > ma[1]:
			return (ma[0] - n) * mi[0]
		else:
			return mi[0] * ma[1]
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().rstrip().split())
	ma1 = [a, x]
	mi1 = [b, y]
	ma2 = ma1[:]
	mi2 = mi1[:]
	c1 = check(mi1, ma1, n)
	c2 = check(ma2, mi2, n)
	print(min(c1, c2))


def ans(a, b, x, y, n):
	a1 = a
	a2 = a
	b1 = b
	b2 = b
	n1 = n
	n2 = n
	val1 = 0
	if n1 >= a1 - x:
		n1 -= a1 - x
		a1 = x
		if n1 >= b1 - y:
			b1 = y
			val1 = a1 * b1
		else:
			b1 -= n1
			val1 = a1 * b1
	else:
		a1 -= n1
		val1 = a1 * b1
	val2 = 0
	if n2 >= b2 - y:
		n2 -= b2 - y
		b2 = y
		if n2 >= a2 - x:
			a2 = x
			val2 = a2 * b2
		else:
			a2 -= n2
			val2 = a2 * b2
	else:
		b2 -= n2
		val2 = a2 * b2
	return min(val1, val2)
m = int(input())
for j in range(m):
	arr = input().split()
	a = int(arr[0])
	b = int(arr[1])
	x = int(arr[2])
	y = int(arr[3])
	n = int(arr[4])
	print(ans(a, b, x, y, n))


t = int(input())
for tc in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, n1) = (a, b, n)
	(a2, b2, n2) = (a, b, n)
	if n1 > a1 - x:
		n1 -= a1 - x
		a1 -= a1 - x
		if n1 > b1 - y:
			b1 -= b1 - y
			n1 -= b1 - y
		else:
			b1 -= n1
	else:
		a1 -= n1
		n1 = 0
	if n2 > b2 - y:
		n2 -= b2 - y
		b2 -= b2 - y
		if n2 > a2 - x:
			a2 -= a2 - x
			n2 -= a2 - x
		else:
			a2 -= n2
	else:
		b2 -= n2
		n2 = 0
	print(min(a1 * b1, a2 * b2))


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

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

	def inputi():
		return stdin.buffer.readline()

def solve():
	(a, b, x, y, n) = map(int, inputi().split())
	if n >= a - x + b - y:
		print(x * y)
	elif x <= y and a - n <= y:
		ac = a - max(x, a - n)
		print((a - ac) * max(y, b + ac - n))
	elif y <= x and b - n <= x:
		bc = b - max(y, b - n)
		print((b - bc) * max(x, a + bc - n))
	elif a < b:
		ac = a - max(x, a - n)
		print((a - ac) * max(y, b + ac - n))
	else:
		bc = b - max(y, b - n)
		print((b - bc) * max(x, a + bc - n))

def main():
	t = int(inputi())
	for _ in range(t):
		solve()
main()


import math
for i in range(0, int(input())):
	(a, b, x, y, n) = map(int, input().split())
	min_a = a - n
	if min_a < x:
		min_a = x
	min_b = b - n
	if min_b < y:
		min_b = y
	if min_a < min_b:
		min_b = b - (n - (a - min_a))
		if min_b < y:
			min_b = y
	else:
		min_a = a - (n - (b - min_b))
		if min_a < x:
			min_a = x
	print(min_a * min_b)


import math
for _ in range(int(input())):
	A = [int(_) for _ in input().split()]
	(a, b, x, y, n) = A
	l = min(a - x, n)
	a -= l
	b -= min(b - y, 0 if n - l < 0 else n - l)
	u = a * b
	(a, b, x, y, n) = A
	l = min(b - y, n)
	b -= l
	a -= min(a - x, 0 if n - l < 0 else n - l)
	v = a * b
	print(min(v, u))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		res = []
		t1 = a
		t2 = b
		tn = n
		if True:
			dif = a - x
			a -= min(n, dif)
			n -= min(n, dif)
			if n:
				dif = b - y
				b -= min(n, dif)
			res.append(a * b)
		a = t1
		b = t2
		n = tn
		if True:
			dif = b - y
			b -= min(n, dif)
			n -= min(n, dif)
			if n:
				dif = a - x
				a -= min(n, dif)
			res.append(a * b)
		print(min(res))


import sys, math
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	c1 = b1
	b1 = max(y1, b1 - n)
	n1 -= c1 - b1
	a1 = max(x1, a1 - n1)
	c = a
	a = max(x, a - n)
	n -= c - a
	b = max(y, b - n)
	print(min(a * b, a1 * b1))


import sys
import math

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

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

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

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	(a, b, x, y, n) = MI()
	if a - min(n, a - x) < b - min(n, b - y):
		(b, a) = (a, b)
		(y, x) = (x, y)
	temp = min(n, b - y)
	n -= temp
	b -= temp
	a -= min(a - x, n)
	print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if y > x:
		(x, y) = (y, x)
		(a, b) = (b, a)
	k1 = a - x
	k2 = b - y
	if n >= k1 + k2:
		print(x * y)
	else:
		m1 = 1
		m2 = 1
		if x >= y:
			if a > b:
				if b - n > y:
					m1 = a
					m2 = b - n
				else:
					m2 = y
					if a - (y - (b - n)) < x:
						m1 = x
					else:
						m1 = a - (y - (b - n))
			elif n >= b - y:
				m2 = y
				m1 = a - (n - (b - y))
				if m1 < x:
					m1 = x
			elif b - n < x:
				m2 = b - n
				m1 = a
			elif n > a - x:
				m1 = x
				m2 = b - (n - (a - x))
			else:
				m1 = a - n
				m2 = b
		print(m1 * m2)


num_inp = lambda : int(input())
arr_inp = lambda : list(map(int, input().split()))
sp_inp = lambda : map(int, input().split())
str_inp = lambda : input()
for s in [*open(0)][1:]:
	(a, b, x, y, n) = map(int, s.split())
	c = max(x, a - n)
	d = max(y, b - n)
	print(min(c * max(y, a + b - n - c), d * max(x, a + b - n - d)))


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


from sys import stdin

def calculate1(a, b, x, y, n):
	i = 0
	buffer = a
	a = max(x, a - n)
	i += buffer - a
	b = max(y, b - (n - i))
	return a * b

def calculate2(a, b, x, y, n):
	i = 0
	buffer = b
	b = max(y, b - n)
	i += buffer - b
	a = max(x, a - (n - i))
	return a * b
sollist = []
N = int(stdin.readline())
for i in range(N):
	buffer = stdin.readline().split()
	a = int(buffer[0])
	b = int(buffer[1])
	x = int(buffer[2])
	y = int(buffer[3])
	n = int(buffer[4])
	sollist.append([a, b, x, y, n])
for i in sollist:
	print(min(calculate1(*i), calculate2(*i)))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(x) for x in input().split(' ')]
	if n >= a - x + b - y:
		print(x * y)
	else:
		sol = []
		if a - n >= x:
			a1 = a - n
			b1 = b
			sol.append(a1 * b1)
		else:
			a1 = x
			dec = n - (a - x)
			b1 = b - dec
			sol.append(a1 * b1)
		if b - n >= y:
			b2 = b - n
			a2 = a
			sol.append(a2 * b2)
		else:
			b2 = y
			dec = n - (b - y)
			a2 = a - dec
			sol.append(a2 * b2)
		print(min(sol))


t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	ans = 10 ** 18
	for _ in range(2):
		aa = min(n, a - x)
		bb = min(n - aa, b - y)
		ans = min(ans, (a - aa) * (b - bb))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x > n:
		ans = (a - n) * b
	else:
		ans = x * (b - min(b - y, n - (a - x)))
	if b - y > n:
		nans = (b - n) * a
	else:
		nans = y * (a - min(a - x, n - (b - y)))
	print(min(ans, nans))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	aco = a
	bco = b
	nco = n
	dif1 = a - x
	dif2 = b - y
	ans = []
	a -= min(dif1, n)
	n -= min(dif1, n)
	b -= min(dif2, n)
	ans.append(a * b)
	n = nco
	a = aco
	b = bco
	b -= min(dif2, n)
	n -= min(dif2, n)
	a -= min(dif1, n)
	ans.append(a * b)
	print(min(ans))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().strip().split()))
	i = max(x, a - n)
	j = max(y, b - n)
	if i <= j:
		ans = i * max(y, a + b - n - i)
	else:
		ans = max(x, a + b - n - j) * j
	print(ans)


t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	bt1 = max(a - n, x)
	bt2 = max(b - n, y)
	if bt1 < bt2:
		s = bt1 * max(y, b - (n - a + bt1))
	else:
		s = bt2 * max(x, a - (n - b + bt2))
	print(s)


T = int(input())
for _ in range(0, T):
	(a, b, x, y, n) = list(map(int, input().split()))
	A = a
	B = b
	N = n
	d1 = a - x
	d2 = b - y
	t1 = min(d1, n)
	a -= t1
	n -= t1
	t2 = min(d2, n)
	b -= t2
	n -= t2
	ans = a * b
	d1 = A - x
	d2 = B - y
	t2 = min(d2, N)
	B -= t2
	N -= t2
	t1 = min(d1, N)
	A -= t1
	N -= t1
	ans = min(ans, A * B)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	i = a
	j = b
	e = n
	p = a - x
	q = b - y
	if p >= n:
		a = a - n
		n = 0
	else:
		n = n - p
		a = x
		if q >= n:
			b = b - n
			n = 0
		else:
			n = n - q
			b = y
	pro1 = a * b
	p = i - x
	q = j - y
	n = e
	if q >= n:
		j = j - n
		n = 0
	else:
		n = n - q
		j = y
		if p >= n:
			i = i - n
			n = 0
		else:
			n = n - p
			i = x
	pro2 = i * j
	print(min(pro1, pro2))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		d = a - x + b - y - n
		ans = 1000000000000000000
		for i in [0, d, a - x, d - b + y, n, d - n]:
			if x + i > a or y + (d - i) > b or i < 0 or (i > d):
				continue
			ans = min(ans, (x + i) * (y + d - i))
		print(ans)


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


t = int(input())
for i in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	a1 = max(a - n, x)
	b1 = max(b - (n - (a - a1)), y)
	b2 = max(b - n, y)
	a2 = max(a - (n - (b - b2)), x)
	print(min(a1 * b1, a2 * b2))


import sys, math, collections
from collections import defaultdict

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

def get_array():
	l = list(map(int, input().split()))
	return l

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

def sod(n):
	(n, c) = (str(n), 0)
	for i in n:
		c += int(i)
	return c

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

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	floor = -1
	while left <= right:
		mid = (left + right) // 2
		if A[mid] == x:
			return A[mid]
		elif x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			left = mid + 1
	return floor

def chk(l, n):
	s = 0
	o = 0
	for i in range(len(l)):
		s += l[i]
		if s > n:
			return 0
		if s == n:
			ind = i
			o = 1
			break
	if o:
		return sum(l[ind + 1:]) == n

def find(a, b, x, y, n):
	ao = -(x - a)
	bo = -(y - b)
	d = min(ao, n)
	a -= d
	n -= d
	b -= min(bo, n)
	n -= min(bo, n)
	return a * b

def main():
	for tt in range(int(input())):
		(a, b, x, y, n) = get_ints()
		o = find(a, b, x, y, n)
		t = find(b, a, y, x, n)
		print(min(o, t))
main()


from collections import deque
from collections import OrderedDict
import math
import sys
import os
import threading
import bisect
import operator
import heapq
from atexit import register
from io import BytesIO
import io
from sys import stdin, stdout
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

def run(v1, v2, l1, l2):
	pass
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if max(a - n, x) <= max(b - n, y):
		difA = min(a - x, n)
		n -= difA
		a -= difA
		difB = min(b - y, n)
		b -= difB
	else:
		difB = min(b - y, n)
		b -= difB
		n -= difB
		difA = min(a - x, n)
		a -= difA
	print(a * b)
sys.exit(0)
n = int(input())
lis = list(map(int, input().split()))
answer = 0
for i in range(n):
	answer += lis[i] - 1
if n == 1:
	print(n - 1)
elif n > 32:
	print(answer)
	sys.exit(0)
lis.sort()
for i in range(2, 50000):
	localMin = 0
	for j in range(n):
		needVal = i ** j
		localMin += abs(lis[j] - needVal)
		if localMin > answer:
			break
	else:
		answer = min(localMin, answer)
print(answer)
sys.exit(0)

class Person:

	def __init__(self, name, age):
		self.name = name
		self.age = age
p1 = Person('heelo', 27)
print(help(Person))
age = 26
name = 'Swaroop'
print('Возрас {} -- {} лет'.format(name, age))
print(help(object))


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

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

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	(a, b, x, y, n) = map(int, input().split())
	(aa, bb, xx, yy, nn) = (a, b, x, y, n)
	b2 = max(b - n, y)
	n -= b - b2
	b = b2
	a2 = max(a - n, x)
	ans = a2 * b2
	(a, b, x, y, n) = (bb, aa, yy, xx, nn)
	b2 = max(b - n, y)
	n -= b - b2
	b = b2
	a2 = max(a - n, x)
	print(min(ans, a2 * b2))


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


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range
R = range

def Golf():
	(n, *t) = map(int, open(0).read().split())

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

def S_():
	return input()

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

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

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

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

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def NLI(n):
	return [[int(i) for i in input().split()] for i in range(n)]

def NLI_(n):
	return [[int(i) - 1 for i in input().split()] for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RA():
	return map(int, open(0).read().split())

def RLI(n=8, a=1, b=10):
	return [random.randint(a, b) for i in range(n)]

def RI(a=1, b=10):
	return random.randint(a, b)

def Rtest(T):
	(case, err) = (0, 0)
	for i in range(T):
		inp = INP()
		(a1, ls) = naive(*inp)
		a2 = solve(*inp)
		if a1 != a2:
			print((a1, a2), inp)
			err += 1
		case += 1
	print('Tested', case, 'case with', err, 'errors')

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

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

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
l_alp = string.ascii_lowercase
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True
ans = 0
for _ in range(I()):
	ans = 0
	(a, b, x, y, n) = LI()
	s = [a * b]
	if a > b:
		(a, b, x, y) = (b, a, y, x)
	if a - x >= n:
		s += [(a - n) * b]
	elif a - x < n:
		s += [x * (b - min(b - y, n - (a - x)))]
	if b - y >= n:
		s += [(b - n) * a]
	elif b - y < n:
		s += [y * (a - min(a - x, n - (b - y)))]
	ans = min(s)
	print(ans)


def solve(a, b, x, y, n):
	aa = max(x, a - n)
	bb = max(y, b - (n - (a - aa)))
	ab = aa * bb
	bb = max(y, b - n)
	aa = max(x, a - (n - (b - bb)))
	ba = aa * bb
	return min(ab, ba)
for _ in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	print(solve(a, b, x, y, n))


t = int(input())
for q in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	a_new = a - n
	b_new = b - n
	min_val = min(x, y)
	conda = a_new >= x
	condb = b_new >= y
	if a + b - n < x + y:
		ans = x * y
	elif conda and condb:
		ans = min(a_new * b, b_new * a)
	elif conda and (not condb):
		if a_new > y:
			if a > a - (n - (b - y)):
				ans = (a - (n - (b - y))) * y
			else:
				ans = a * y
		else:
			ans = a_new * b
	elif condb and (not conda):
		if b_new > x:
			if b > b - (n - (a - x)):
				ans = x * (b - (n - (a - x)))
			else:
				ans = x * b
		else:
			ans = a * b_new
	elif not conda and (not condb):
		if a + b - n < x + y:
			ans = x * y
		elif min_val == x:
			if a_new >= x:
				ans = a_new * b
			else:
				b = b - (n - (a - x))
				ans = x * b
		elif min_val == y:
			if b_new >= y:
				ans = a * b_new
			else:
				a = a - (n - (b - y))
				ans = a * y
	print(ans)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1) = (a, b)
	t = min(n, a1 - x)
	a1 = a1 - t
	q = min(n - t, b - y)
	b1 = b1 - q
	m1 = a1 * b1
	(a1, b1) = (a, b)
	t = min(n, b - y)
	b1 = b1 - t
	q = min(n - t, a - x)
	a1 = a1 - q
	m2 = a1 * b1
	print(min(m1, m2))


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

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

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

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

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

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

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.append(arr)
	return lst

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

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
k = ip()
while k:
	k -= 1
	(a, b, x, y, n) = mip()
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		p = a
		g = b
		v = n
		z = a - x
		if z < n:
			a = x
			n -= z
			if n > b - y:
				b = y
			else:
				b -= n
		else:
			a -= n
		z = g - y
		if z < v:
			g = y
			v -= z
			if v > p - x:
				p = x
			else:
				p -= v
		else:
			g -= v
		print(min(a * b, p * g))


t = int(input())
while t != 0:
	(A, B, X, Y, N) = input().split()
	a = int(A)
	b = int(B)
	x = int(X)
	y = int(Y)
	n = int(N)
	p = a
	q = b
	m = n
	i = p - x
	j = q - y
	if i >= n:
		p = p - n
	else:
		p = x
		m = m - i
		if j >= m:
			q = q - m
		else:
			q = y
	i = a - x
	j = b - y
	if j >= n:
		b = b - n
	else:
		b = y
		n = n - j
		if i >= n:
			a = a - n
		else:
			b = y
	print(min(a * b, p * q))
	t = t - 1


from sys import *
input = stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	mn = 1e+20
	n1 = n
	(k, a1) = (a, a)
	b1 = b
	a1 -= min(k - x, n1)
	n1 -= min(k - x, n1)
	if n1 > 0:
		b1 = b
		b1 -= min(b1 - y, n1)
	mn = min(mn, a1 * b1)
	n2 = n
	(k, a2) = (b, b)
	b2 = a
	a2 -= min(k - y, n2)
	n2 -= min(k - y, n2)
	if n2 > 0:
		b2 -= min(b2 - x, n2)
	mn = min(mn, a2 * b2)
	stdout.write(str(mn) + '\n')


t = int(input())
while t > 0:
	(a, b, x, y, n) = list(map(int, input().split()))
	min1 = 1e+19
	a1 = a - n
	if a1 >= x:
		z = a1 * b
		min1 = min(min1, z)
	b1 = b - n
	if b1 >= y:
		z = b1 * a
		min1 = min(min1, z)
	n1 = n - (a - x)
	if n1 >= 0:
		b1 = b - n1
		if b1 >= y:
			z = x * b1
			min1 = min(min1, z)
	n1 = n - (b - y)
	if n1 >= 0:
		a1 = a - n1
		if a1 >= x:
			z = y * a1
			min1 = min(min1, z)
	l = a - x + (b - y)
	if l <= n:
		z = x * y
		min1 = min(min1, z)
	print(min1)
	t -= 1


t = int(input())
for z in range(t):
	(a, b, x, y, n) = [int(q) for q in input().split()]
	(c, d, o) = (a, b, n)
	if c - x < n:
		o = o - (c - x)
		c = x
		d = max(d - o, y)
		s = c * d
	else:
		c -= o
		s = c * d
	if b - y < n:
		n = n - (b - y)
		b = y
		a = max(a - n, x)
		v = a * b
	else:
		b -= n
		v = a * b
	print(min(s, v))


import sys
input = sys.stdin.readline

def sol1(a, b, x, y, n):
	if a - x < n:
		n -= a - x
		a = x
		b -= n
	else:
		a -= n
	return a * b

def sol2(a, b, x, y, n):
	if b - y < n:
		n -= b - y
		b = y
		a -= n
	else:
		b -= n
	return a * b
for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) < n:
		print(x * y)
	else:
		print(min(sol1(a, b, x, y, n), sol2(a, b, x, y, n)))


from sys import stdin, stdout
test = int(stdin.readline())
for _ in range(test):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	ans = float('inf')
	d1 = a - x
	d2 = b - y
	if d1 + d2 <= n:
		print(x * y)
		continue
	(ok1, ok2) = (True, True)
	if d1 >= n:
		ans = min(ans, (a - n) * b)
		ok1 = False
	if d2 >= n:
		ans = min(ans, (b - n) * a)
		ok2 = False
	if ok1:
		ans = min(ans, x * (b - (n - d1)))
	if ok2:
		ans = min(ans, y * (a - (n - d2)))
	print(ans)


t = int(input())
while t:
	(a, b, x, y, n) = input().split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	if a - x >= n and b - y >= n:
		print((min(a, b) - n) * max(a, b))
	elif a - x >= n and b - y <= n:
		print(min(b * (a - n), y * (a - (n - b + y))))
	elif a - x <= n and b - y >= n:
		print(min(a * (b - n), x * (b - (n - a + x))))
	elif a - x + b - y > n:
		print(min(x * (b - (n - a + x)), y * (a - (n - b + y))))
	else:
		print(x * y)
	t = t - 1


from itertools import permutations
from collections import defaultdict
from math import *
import os
import sys
from io import BytesIO, IOBase
from heapq import nlargest
from bisect import *
import copy
import itertools
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

def input():
	return sys.stdin.readline().rstrip('\r\n')
t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	val = 0
	n1 = n
	isprinted = False
	(ans1, ans2) = (0, 0)
	if a - n >= x:
		ans1 = (a - n) * b
	else:
		n -= a - x
		if b - n >= y:
			ans1 = (b - n) * x
		else:
			ans1 = x * y
	n = n1
	if b - n >= y:
		ans2 = (b - n) * a
	else:
		n -= b - y
		if a - n >= x:
			ans2 = (a - n) * y
		else:
			ans2 = x * y
	print(min(ans1, ans2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		left = max(0, n + y - b)
		right = min(n, a - x)
		ca = a - left
		cb = b + left - n
		ans = ca * cb
		ca = a - right
		cb = b + right - n
		ans = min(ans, ca * cb)
		print(ans)


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

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

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

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

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

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

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

def parr():
	return [value() for i in range(n)]
mo = 1000000007
for _ in range(inn()):
	(a, b, x, y, n) = value()
	res1 = a - x
	res2 = b - y
	if n >= res1 + res2:
		print(x * y)
	else:
		mn = min(res1, n)
		val = n
		val -= mn
		if val == 0:
			ans = b * (a - mn)
		else:
			mn = min(res2, val)
			ans = x * (b - mn)
		mn = min(res2, n)
		n -= mn
		if n == 0:
			ans = min(ans, a * (b - mn))
		else:
			mn = min(res1, n)
			ans = min(ans, y * (a - mn))
		print(ans)


def f(a, b, x, y, n):
	if a - x >= n:
		return (a - n) * b
	else:
		return x * max(y, b - (n - (a - x)))
t = int(input())
for j in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(f(a, b, x, y, n), f(b, a, y, x, n)))


import math
for _ in range(int(input())):
	X = [int(_) for _ in input().split()]
	(a, b, x, y, n) = X
	k = min(a - x, n)
	a -= k
	b -= min(b - y, 0 if n - k < 0 else n - k)
	p = a * b
	(a, b, x, y, n) = X
	l = min(b - y, n)
	b -= l
	a -= min(a - x, 0 if n - l < 0 else n - l)
	q = a * b
	print(min(p, q))


import math
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	min_a = a
	if a - n < x:
		min_a = x * max(b - (n - (a - x)), y)
	else:
		min_a = (a - n) * b
	if b - n < y:
		min_b = y * max(a - (n - (b - y)), x)
	else:
		min_b = (b - n) * a
	print(min(min_a, min_b))


def fun(a, b, x, y, n):
	k = a - x
	if n >= k:
		a = x
		n = n - k
	else:
		a = a - n
		n = 0
	k = b - y
	if n >= k:
		b = y
		n = n - k
	else:
		b = b - n
		n = 0
	return a * b

def fun1(a, b, x, y, n):
	k = b - y
	if n >= k:
		b = y
		n = n - k
	else:
		b = b - n
		n = 0
	k = a - x
	if n >= k:
		a = x
		n = n - k
	else:
		a = a - n
		n = 0
	return a * b
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	p = fun1(a, b, x, y, n)
	q = fun(a, b, x, y, n)
	print(min(p, q))


import io
import os
import sys
import math
import heapq
import bisect
import random
import string
import decimal
import functools
import fractions
import itertools
import collections
from sys import stdin, stdout
from io import BytesIO, IOBase
from math import gcd, floor, sqrt, log, factorial
from bisect import bisect_left, bisect_right
from collections import deque, Counter, defaultdict, OrderedDict, namedtuple, UserDict, UserList, UserString
MOD = 1000000007
sys.setrecursionlimit(100000000)
BUFSIZE = 8192

def solve(a, b, x, y, n):
	min1 = calc_min_moves(a, b, x, y, n)
	min2 = calc_min_moves(b, a, y, x, n)
	return min(min1, min2)

def calc_min_moves(a, b, x, y, n):
	moves_a = min(n, a - x)
	moves_b = min(n - moves_a, b - y)
	reduced_a = a - moves_a
	reduced_b = b - moves_b
	return reduced_a * reduced_b
t = int(input())
results = []
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	results.append(solve(a, b, x, y, n))
for result in results:
	print(result)


import io
import os
from collections import Counter, defaultdict, deque

def solve(A, B, X, Y, N):
	decA = min(N, A - X)
	N -= decA
	A -= decA
	decB = min(N, B - Y)
	N -= decB
	B -= decB
	return A * B
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(A, B, X, Y, N) = [int(x) for x in input().split()]
	ans = min(solve(A, B, X, Y, N), solve(B, A, Y, X, N))
	print(ans)


import sys
input = sys.stdin.readline

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

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

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

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

class Solution:

	def main(self, a, b, x, y, n):
		self.minProd = x * y if a - x + (b - y) <= n else a * b
		min1 = a - n if a - n >= x else x
		min2 = b - n if b - n >= y else y
		if min1 < min2:
			if a - n >= x:
				a -= n
			else:
				n -= a - x
				a = x
				if b - n >= y:
					b -= n
				else:
					b = y
		elif b - n >= y:
			b -= n
		else:
			n -= b - y
			b = y
			if a - n >= x:
				a -= n
			else:
				a = x
		return a * b
t = inp()
solution = Solution()
for _ in range(t):
	(a, b, x, y, n) = inlt()
	res = solution.main(a, b, x, y, n)
	print(res)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if n >= a - x:
		n = n - (a - x)
		a = x
	else:
		a -= n
		n = 0
	if n >= b - y:
		n -= b - y
		b = y
	else:
		b -= n
		n = 0
	c = a * b
	if n1 >= b1 - y1:
		n1 -= b1 - y1
		b1 = y1
	else:
		b1 -= n1
		n1 = 0
	if n1 >= a1 - x1:
		n1 -= a1 - x1
		a1 = x1
	else:
		a1 -= n1
		n1 = 0
	d = a1 * b1
	print(min(c, d))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if max(a - n, x) < max(b - n, y):
		amn = max(a - n, x)
		n -= a - amn
		bmn = max(b - n, y)
		print(amn * bmn)
	else:
		bmn = max(b - n, y)
		n -= b - bmn
		amn = max(a - n, x)
		print(amn * bmn)


import sys
ll = lambda : list(map(int, input().split()))
lls = lambda : list(map(str, input().split()))
fin = lambda : list(map(float, input().split()))
st = lambda : input()
v = lambda : map(int, input().split())
ii = lambda : int(input())
mod = 10 ** 9 + 7
from math import *
from datetime import datetime
from collections import *
import math
for _ in range(ii()):
	(a, b, x, y, n) = v()
	a1 = a
	b1 = b
	n1 = n
	s1 = 0
	s2 = 0
	if b - y <= n:
		s = b - y
		b = y
		n = n - abs(s)
	else:
		b = b - n
		n = 0
	if n > 0:
		if a - x <= n:
			a = x
		else:
			a = a - n
	if a1 - x <= n1:
		s = a1 - x
		a1 = x
		n1 = n1 - abs(s)
	else:
		a1 = a1 - n1
		n1 = 0
	if n1 > 0:
		if b1 - y <= n1:
			b1 = y
		else:
			b1 = b1 - n1
	print(min(a1 * b1, a * b))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	c = a
	d = b
	k = n
	a = a - min(a - x, n)
	n = n - min(abs(c - x), n)
	b = b - min(b - y, n)
	temp = a * b
	a = c
	b = d
	n = k
	b = b - min(b - y, n)
	n = n - min(abs(d - y), n)
	a = a - min(a - x, n)
	temp2 = a * b
	print(min(temp, temp2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(aa, bb, xx, yy, nn) = (a, b, x, y, n)
	t = min(a - x, n)
	n -= t
	a -= t
	t = min(b - y, n)
	n -= t
	b -= t
	ans = a * b
	(a, b, x, y, n) = (aa, bb, xx, yy, nn)
	t = min(b - y, n)
	n -= t
	b -= t
	t = min(a - x, n)
	n -= t
	a -= t
	ans = min(ans, a * b)
	print(ans)


def lpv(iv, lv, pm):
	if iv - lv >= pm:
		return iv - pm
	return lv
for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if lpv(b, y, n) < lpv(a, x, n):
		(a, b, x, y) = (b, a, y, x)
	if a - x >= n:
		a -= n
		n = 0
	else:
		n -= a - x
		a = x
	if b - y >= n:
		b -= n
	else:
		b = y
	print(a * b)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = 10 ** 18
	for j in range(2):
		c = min(a - x, n)
		d = min(b - y, n - c)
		ans = min(ans, (a - c) * (b - d))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	res1 = 0
	res2 = 0
	A = a
	B = b
	N = n
	if A - x > N:
		A -= N
		res1 = A * B
	else:
		N -= A - x
		A = x
		B = max(B - N, y)
		res1 = A * B
	A = a
	B = b
	N = n
	if B - y > N:
		B -= N
		res2 = A * B
	else:
		N -= B - y
		B = y
		A = max(A - N, x)
		res2 = A * B
	print(min(res1, res2))


def do():
	q = int(input())
	import math
	for _ in range(q):
		(a, b, x, y, n) = map(int, input().split())
		aa = a - min(n, a - x)
		bb = b - min(n, b - y)
		if aa < bb:
			val = min(n, a - x)
			a -= val
			n -= val
			b -= min(n, b - y)
		else:
			val = min(n, b - y)
			b -= val
			n -= val
			a -= min(n, a - x)
		print(a * b)
do()


l = ''
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 10 ** 18
	for i in range(2):
		aa = min(n, a - x)
		bb = min(n - aa, b - y)
		ans = min(ans, (a - aa) * 1 * (b - bb))
		(a, b) = (b, a)
		(x, y) = (y, x)
	l += f'{ans}\n'
print(l)


for tc in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	copy_a = int(a)
	copy_b = int(b)
	copy_n = int(n)
	a_x = a - x
	b_y = b - y
	if a_x >= n and b_y >= n:
		print((min(a, b) - n) * max(a, b))
	else:
		if a >= b:
			temp = min(b - y, n)
			n -= temp
			b -= temp
			if n > 0:
				a -= min(n, a - x)
		else:
			temp = min(a - x, n)
			n -= temp
			a -= temp
			if n > 0:
				b -= min(b - y, n)
		if a_x >= b_y:
			temp = min(a_x, copy_n)
			copy_a -= temp
			copy_n -= temp
			if copy_n > 0:
				copy_b -= min(b_y, copy_n)
		else:
			temp = min(b_y, copy_n)
			copy_b -= temp
			copy_n -= temp
			if copy_n > 0:
				copy_a -= min(a_x, copy_n)
		print(min(a * b, copy_a * copy_b))


import sys

def task():
	(a, b, x, y, n) = map(int, input().split())
	aa = max(1, a - n, x)
	bb = max(1, b - n, y)
	if aa < bb:
		aaa = aa
		bbb = max(1, b - (n - (a - aaa)), y)
	else:
		bbb = bb
		aaa = max(1, a - (n - (b - bbb)), x)
	return aaa * bbb
n = int(input())
for i in range(n):
	print(task())


def op(a, x, b, y, n):
	if a - x >= n:
		a -= n
		n = 0
	else:
		n -= a - x
		a = x
	if n > 0:
		if b - y >= n:
			b -= n
		else:
			b = y
	return a * b
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(op(a, x, b, y, n), op(b, y, a, x, n)))


import math
from collections import defaultdict
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	ta = b
	tb = a
	tx = y
	ty = x
	tn = n
	if n >= a - x + (b - y):
		print(x * y)
	else:
		a = a - n
		temp = a
		if a < x:
			a += x - a
			n = 0
			n += a - temp
		else:
			n = 0
		b = b - n
		tem2 = b
		if b < y:
			b += y - b
		ans1 = a * b
		ta = ta - tn
		temp = ta
		if ta < tx:
			ta += tx - ta
			tn = 0
			tn += ta - temp
		else:
			tn = 0
		tb = tb - tn
		tem2 = tb
		if tb < ty:
			tb += ty - tb
		ans2 = ta * tb
		print(min(ans1, ans2))


import sys, math
try:
	(sys.stdin, sys.stdout) = (open('input.txt', 'r'), open('out.txt', 'w'))
except:
	pass
from sys import stdin, stdout
mod = int(1000000000.0 + 7)
from statistics import mode
from collections import *
from math import ceil, floor, inf, factorial, gcd, log2, sqrt, log
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()

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

def setbits(n):
	return bin(n).count('1')

def resetbits(n):
	return bin(n).count('0')

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r):
	(num, den) = (1, 1)
	r = min(n, n - r)
	for i in range(r):
		num *= n - i
		den *= i + 1
	return num // den

def ncr_p(n, r, p):
	(num, den) = (1, 1)
	r = min(r, n - r)
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * modinv(den, p) % p

def isPrime(num):
	if num <= 1:
		return False
	if num == 2 or n == 3:
		return True
	if num % 2 == 0 or num % 3 == 0:
		return False
	m = int(num ** 0.5) + 1
	for i in range(5, m, 6):
		if num % i == 0 or num % (i + 2) == 0:
			return False
	return True

def bin_search(s, low, high, val):
	while low <= high:
		mid = low + (high - low) // 2
		if s[mid] == val:
			return mid
		elif s[mid] < val:
			low = mid + 1
		else:
			high = mid - 1
	return -1

def sumofdigit(num):
	count = 0
	while num:
		count += num % 10
		num //= 10
	return count

def inputmatrix():
	(r, c) = iia()
	mat = [0] * r
	for i in range(r):
		mat[i] = iia()
	return (r, c, mat)

def prefix_sum(n, s):
	for i in range(1, n):
		s[i] += s[i - 1]
	return s

def binomial(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def divisors(n):
	res = []
	for i in range(1, ceil(sqrt(n)) + 1):
		if n % i == 0:
			if i == n // i:
				res.append(i)
			else:
				res.append(i)
				res.append(n // i)
	return res
for _ in range(ii1()):
	(a, b, x, y, n) = iia()
	if a - x < n:
		x_rem = a - x
	else:
		x_rem = n
	if b - y < n:
		y_rem = b - y
	else:
		y_rem = n
	if a - x + b - y < n:
		print(x * y)
	else:
		if n - x_rem > 0:
			r1 = n - x_rem
		else:
			r1 = 0
		if n - y_rem > 0:
			r2 = n - y_rem
		else:
			r2 = 0
		p1 = (a - x_rem) * (b - r1)
		p2 = (b - y_rem) * (a - r2)
		print(min(p1, p2))


t = int(input())
while t > 0:
	(a, b, x, y, n) = map(int, input().split())
	l = max(b - n, y)
	br = max(a - (n - b + l), x)
	ans1 = l * br
	l = max(a - n, x)
	br = max(b - (n - a + l), y)
	ans2 = l * br
	print(min(ans1, ans2))
	t -= 1


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

	def val(a, b, x, y, n):
		diff_a_x = a - x
		diff_b_y = b - y
		if diff_a_x <= n:
			a = x
			n -= diff_a_x
		else:
			a -= n
			n = 0
		if n > 0:
			if diff_b_y <= n:
				b = y
				n -= diff_b_y
			else:
				b -= n
				n = 0
		return a * b
	ans = min(val(a, b, x, y, n), val(b, a, y, x, n))
	print(ans)


import sys, math, heapq, copy
from collections import defaultdict, deque
from bisect import bisect_left, bisect_right
from functools import cmp_to_key
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	p1 = a - x
	p2 = b - y
	(temp_a, temp_b, temp_n) = (a, b, n)
	a -= min(n, p1)
	n -= min(n, p1)
	b -= min(n, p2)
	n -= min(n, p2)
	temp_b -= min(temp_n, p2)
	temp_n -= min(temp_n, p2)
	temp_a -= min(temp_n, p1)
	temp_n -= min(temp_n, p1)
	p1 = a * b
	p2 = temp_a * temp_b
	print(min(p1, p2))


import math
test = int(input())
for t in range(test):
	(a, b, x, y, m) = map(int, input().split())
	c = a
	g = b
	m1 = m
	e = b - y
	f = a - x
	b -= min(m, e)
	m -= min(m, e)
	a -= min(m, f)
	m -= min(m, f)
	e1 = g - y
	f1 = c - x
	c -= min(m1, f1)
	m1 -= min(m1, f1)
	g -= min(m1, e1)
	print(min(c * g, a * b))


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		res = x * y
	else:
		res = 10 ** 20
		if b - y <= n:
			nn = n - (b - y)
			res = min(res, (a - nn) * y)
		else:
			res = min(res, a * (b - n))
		if a - x <= n:
			nn = n - (a - x)
			res = min(res, x * (b - nn))
		else:
			res = min(res, (a - n) * b)
	print(res)


t = int(input())
SUM = []
for i in range(t):
	(a, b, x, y, n) = input().split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	ans = float('inf')
	for i in range(2):
		ans = min(ans, (a - min(n, a - x)) * (b - min(n - min(n, a - x), b - y)))
		(a, b) = (b, a)
		(x, y) = (y, x)
	SUM.append(ans)
for i in range(t):
	print(SUM[i])


t = input()
result = []
for i in range(int(t)):
	(a, b, x, y, n) = map(int, input().split())
	ans = 10 ** 18
	for j in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * 1 * (b - db))
		(a, b) = (b, a)
		(x, y) = (y, x)
	result.append(ans)
print(*result, sep='\n')


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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

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

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
n = int(input())
for _ in range(n):
	(a, b, x, y, n) = map(int, sys.stdin.readline().rstrip().split())
	a1 = max(x, a - n)
	b1 = max(y, b - (n - a + a1))
	b2 = max(y, b - n)
	a2 = max(x, a - (n - b + b2))
	print(min(a1 * b1, a2 * b2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	product = a * b
	curN = n
	newA = x
	if a - x > curN:
		newA = a - curN
	product = min(product, newA * b)
	if a - x <= curN:
		curN -= a - x
		newB = y
		if b - y > curN:
			newB = b - curN
		product = min(product, newA * newB)
	curN = n
	newB = y
	if b - y > curN:
		newB = b - curN
	product = min(product, a * newB)
	if b - y <= curN:
		curN -= b - y
		newA = x
		if a - x > curN:
			newA = a - curN
		product = min(product, newA * newB)
	print(product)


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.buffer.readline().rstrip()
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(max(a - n, x) * max(b - (n - (a - max(a - n, x))), y), max(b - n, y) * max(a - (n - (b - max(b - n, y))), x)))


test = int(input())
while test > 0:
	test -= 1
	(a, b, x, y, n) = map(int, input().split())
	rs = a * b
	k = min(a - x, n)
	rs = min(rs, (a - k) * max(y, b - (n - k)))
	k = min(b - y, n)
	rs = min(rs, (b - k) * max(x, a - (n - k)))
	print(rs)


t = int(input())
temp = 0
for i in range(0, 10):
	temp += 10
for j in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	o = 10 ** 19 + 1
	if a1 - n >= x:
		o = min((a1 - n) * b1, o)
	elif b1 - (n - (a1 - x)) >= y:
		o = min((b1 - (n - (a1 - x))) * x, o)
	else:
		o = min(x * y, o)
	if b - n >= y:
		o = min((b - n) * a, o)
	elif a - (n - (b - y)) >= x:
		o = min((a - (n - (b - y))) * y, o)
	else:
		o = min(y * x, o)
	print(o)


testCase = int(input())
while testCase != 0:
	testCase -= 1
	(a, b, x, y, n) = [int(x) for x in input().split()]
	if max(a - n, x) > max(b - n, y):
		(x, y) = (y, x)
		(a, b) = (b, a)
	if a - x >= n:
		a -= n
		n = 0
	else:
		n -= a - x
		a = x
	if n != 0:
		if b - y >= n:
			b -= n
		else:
			b = y
	print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, nc) = list(map(int, input().split()))
	extra = a - x + b - y
	if nc < extra:
		n = nc
		diff1 = a - x
		if diff1 >= nc:
			ans1 = (a - n) * b
		else:
			n -= diff1
			ans1 = x * max(b - n, y)
		n = nc
		diff2 = b - y
		if diff2 >= nc:
			ans2 = a * (b - n)
		else:
			n -= diff2
			ans2 = max(a - n, x) * y
		print(min(ans1, ans2))
	else:
		print(x * y)


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		l = []
		if a - n >= x and b - n >= y:
			p = a - n
			l.append(p * b)
			q = b - n
			l.append(a * q)
		elif a - n >= x and b - n < y:
			l.append((a - n) * b)
			diff = b - y
			d = n - diff
			l.append((a - d) * y)
		elif a - n < x and b - n >= y:
			l.append((b - n) * a)
			diff = a - x
			d = n - diff
			l.append(x * (b - d))
		else:
			diff = a - x
			d = n - diff
			l.append(x * (b - d))
			diff = b - y
			d = n - diff
			l.append((a - d) * y)
		print(min(l))


for _ in range(int(input())):
	(a, b, x, y, n) = [int(c) for c in input().split()]
	(ad, bd, xd, yd, nd) = (a, b, x, y, n)
	newa = max(x, a - n)
	diff = a - newa
	n = n - diff
	if n > 0:
		b = max(y, b - n)
	ans1 = newa * b
	newb = max(yd, bd - nd)
	diff = bd - newb
	nd -= diff
	if nd > 0:
		ad = max(xd, ad - nd)
	ans2 = ad * newb
	print(min(ans1, ans2))


for x in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		t = a
		t1 = b
		t2 = n
		if n >= a - x:
			n = n - (a - x)
			a = x
			if n > 0:
				b = b - n
		else:
			a = a - n
		m = a * b
		a = t
		b = t1
		n = t2
		if n >= b - y:
			n = n - (b - y)
			b = y
			if n > 0:
				a = a - n
		else:
			b = b - n
		print(min(a * b, m))


out = list()
t = int(input())
for i in range(0, t):
	(a, b, x, y, n) = input().split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	if a - n >= x and b - n >= y:
		out.append(min((a - n) * b, (b - n) * a))
	else:
		mina = max(a - n, x)
		minb = max(b - n, y)
		ost = n - (a - mina)
		a1 = mina
		b1 = max(y, b - ost)
		if minb < mina:
			ost = n - (b - minb)
			b1 = minb
			a1 = max(x, a - ost)
		out.append(a1 * b1)
for i in out:
	print(i)


for ad in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a - x + b - y <= n:
		print(x * y)
	else:
		if max(a - n, x) <= max(b - n, y):
			if a - n >= x:
				ans = (a - n) * b
			else:
				ans = x * (b - (n - a + x))
		elif b - n >= y:
			ans = (b - n) * a
		else:
			ans = y * (a - (n - b + y))
		print(ans)


def readGenerator():
	while True:
		tokens = input().split(' ')
		for t in tokens:
			yield t
reader = readGenerator()

def readWord():
	return next(reader)

def readInt():
	return int(next(reader))

def readFloat():
	return float(next(reader))

def readLine():
	return input()

def solve(n):
	return n

def solve(a, b, x, y, n):
	minA = a - min(n, a - x)
	minB = b - min(n, b - y)
	if minA < minB:
		n -= a - minA
		minB = b - min(n, b - y)
	else:
		n -= b - minB
		minA = a - min(n, a - x)
	return minA * minB
tests = readInt()
for _ in range(0, tests):
	a = readInt()
	b = readInt()
	x = readInt()
	y = readInt()
	n = readInt()
	print(solve(a, b, x, y, n))


def solve():
	T = int(input())
	ans = [float('inf')] * T
	for t in range(T):
		(a, b, x, y, n) = map(int, input().split())
		(p, q) = (a - x, b - y)
		d = p + q - n
		if d <= 0:
			ans[t] = x * y
		else:
			r = max(x, a - n)
			ans[t] = min(ans[t], r * (a + b - r - n))
			r = min(a, a + b - n - y)
			ans[t] = min(ans[t], r * (a + b - r - n))
	return ans
print(*solve(), sep='\n')


t = int(input())
i = 0
while i < t:
	A = list(map(int, input().split()))
	a = A[0]
	b = A[1]
	x = A[2]
	y = A[3]
	n = A[4]
	C = a - x
	D = b - y
	if True:
		if n >= C:
			a = x
			n -= C
		else:
			a -= n
			n = 0
		if n >= D and n > 0:
			b = y
			n -= D
		elif n < D:
			b -= n
		ans1 = a * b
	a = A[0]
	b = A[1]
	x = A[2]
	y = A[3]
	n = A[4]
	if True:
		if n >= D:
			b = y
			n -= D
		else:
			b -= n
			n = 0
		if n >= C and n > 0:
			a = x
			n -= C
		else:
			a -= n
		ans2 = a * b
	print(min(ans1, ans2))
	i += 1


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


def go(a1, b1, x, y, n1):
	diff1 = abs(x - a1)
	diff2 = abs(y - b1)
	ans = min(diff1, n1)
	a1 -= ans
	n1 -= ans
	ans2 = min(diff2, n1)
	b1 -= ans2
	n1 -= ans2
	return a1 * b1

def go2(a2, b2, x, y, n2):
	diff1 = abs(x - a2)
	diff2 = abs(y - b2)
	ans3 = min(diff2, n2)
	b2 -= ans3
	n2 -= ans3
	ans4 = min(diff1, n2)
	a2 -= ans4
	n2 -= ans4
	return a2 * b2
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	res1 = go(a, b, x, y, n)
	res2 = go2(a, b, x, y, n)
	print(min(res2, res1))


t = int(input())
while t > 0:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	if a - x <= n:
		k = n - (a - x)
		prod = x * max(b - k, y)
	elif a - x > n:
		prod = b * (a - n)
	if b - y <= n:
		k = n - (b - y)
		ans = y * max(a - k, x)
	elif b - y > n:
		ans = a * (b - n)
	print(min(ans, prod))


t = int(input())
for i in range(t):
	nums = [int(i) for i in input().split()]
	a = nums[0]
	b = nums[1]
	x = nums[2]
	y = nums[3]
	n = nums[4]
	dop_n = 0
	variants = []
	if a - x >= n:
		a -= n
	elif a - x < n:
		dop_n = n - (a - x)
		a -= a - x
	b = b - dop_n
	if b < y:
		b = y
	variants.append(a * b)
	a = nums[0]
	b = nums[1]
	x = nums[2]
	y = nums[3]
	n = nums[4]
	dop_n = 0
	if b - y >= n:
		b -= n
	elif b - y < n:
		dop_n = n - (b - y)
		b -= b - y
	a = a - dop_n
	if a < x:
		a = x
	variants.append(a * b)
	print(min(variants))


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


def cal(a, b, x, y, n):
	if a == x and b == y:
		return a * b
	ans = a * b
	mins_a = min(a - x, n)
	temp_a = a - mins_a
	temp_n = n - mins_a
	mins_b = min(b - y, temp_n)
	temp_b = b - mins_b
	ans = min(ans, temp_a * temp_b)
	mins_b = min(b - y, n)
	temp_b = b - mins_b
	temp_n = n - mins_b
	mins_a = min(a - x, temp_n)
	temp_a = a - mins_a
	ans = min(ans, temp_a * temp_b)
	return ans
t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	print(cal(a, b, x, y, n))
	t -= 1


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	d = max(0, n - a + x)
	ans = max(x, a - n) * max(y, b - d)
	d = max(0, n - b + y)
	ans = min(ans, max(y, b - n) * max(x, a - d))
	print(ans)


def min_prod(a, b, x, y, n):
	if n == 0:
		return a * b
	ans1 = min_prod(a - 1, b, x, y, n - 1) if a > x else None
	ans2 = min_prod(a, b - 1, x, y, n - 1) if b > y else None
	if ans1 and ans2:
		return min(ans1, ans2)
	if not ans1 and ans2:
		return ans2
	if not ans2 and ans1:
		return ans1
	return a * b
t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = input().split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	na = min(n, a - x)
	nb = min(n - na, b - y)
	ans1 = (a - na) * (b - nb)
	nb = min(n, b - y)
	na = min(n - nb, a - x)
	ans2 = (a - na) * (b - nb)
	print(min(ans1, ans2))


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


def min_product(a, b, x, y, n):
	total = a + b - n
	aMin = max(a - n, x)
	bMin = max(b - n, y)
	if aMin < bMin:
		print(aMin * max(total - aMin, bMin))
	else:
		print(bMin * max(total - bMin, aMin))
	return
	if a < b:
		if a - n >= x:
			print((a - n) * b)
		else:
			print(x * (b - (n - (a - x))))
	elif b - n >= y:
		print((b - n) * a)
	else:
		print(y * (a - (n - (b - y))))
x = input()
for i in range(int(x)):
	v = [int(x) for x in input().split(' ')]
	min_product(v[0], v[1], v[2], v[3], v[4])


a = int(input())
for i in range(a):
	(b, c, x, y, n) = map(int, input().split())
	d1 = min(b - x, n)
	b1 = b - d1
	n1 = n - d1
	c1 = c - min(n1, c - y)
	d2 = min(c - y, n)
	c2 = c - d2
	n2 = n - d2
	b2 = b - min(n2, b - x)
	print(min(b1 * c1, b2 * c2))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	r1 = max(a - n, x) * max(b - max(0, n - (a - x)), y)
	r2 = max(b - n, y) * max(a - max(0, n - (b - y)), x)
	print(min(r1, r2))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	if n >= a - x + b - y:
		print(x * y)
	elif x == min(x, y):
		if n >= a - x:
			n -= a - x
			a = x
			b -= n
			print(a * b)
		elif n >= b - y:
			if y == min(a - n, y):
				n -= b - y
				b = y
				a -= n
				print(a * b)
			else:
				a -= n
				print(a * b)
		elif a - n == min(a - n, b - n):
			print((a - n) * b)
		else:
			print(a * (b - n))
	elif y == min(x, y):
		if n >= b - y:
			n -= b - y
			b = y
			a -= n
			print(a * b)
		elif n >= a - x:
			if x == min(b - n, x):
				n -= a - x
				a = x
				b -= n
				print(a * b)
			else:
				b -= n
				print(a * b)
		elif a - n == min(a - n, b - n):
			print((a - n) * b)
		else:
			print(a * (b - n))


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase

def main():

	def solve():
		(a, b, minA, minB, n) = [int(x) for x in input().split()]
		initial = [a, b, n]
		a -= n
		if a < minA:
			n = minA - a
			a = minA
		else:
			n = 0
		b -= n
		if b < minB:
			b = minB
		finalAnswerA = a * b
		(a, b, n) = initial
		(a, b) = (b, a)
		(minA, minB) = (minB, minA)
		a -= n
		if a < minA:
			n = minA - a
			a = minA
		else:
			n = 0
		b -= n
		if b < minB:
			b = minB
		finalAnswerB = a * b
		print(min(finalAnswerA, finalAnswerB))
	t = int(input())
	for i in range(t):
		solve()
BUFFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

def print(*args, **kwargs):
	sep = kwargs.pop('sep', ' ')
	file = kwargs.pop('file', sys.stdout)
	atStart = True
	for x in args:
		if not atStart:
			file.write(sep)
		file.write(str(x))
		atStart = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
main()


k = int(input())
for i in range(k):
	(a, b, x, y, n) = map(int, input().split())
	temp1 = a
	temp2 = b
	comp1 = a - x
	comp2 = b - y
	ntemp1 = n
	ntemp2 = n
	if comp2 >= n:
		temp2 = temp2 - n
		ntemp2 = 0
	else:
		temp2 = temp2 - comp2
		ntemp2 = ntemp2 - comp2
	if comp1 >= n:
		temp1 = temp1 - n
		ntemp1 = 0
	else:
		temp1 = temp1 - comp1
		ntemp1 = ntemp1 - comp1
	if temp1 > temp2:
		b = temp2
		n = ntemp2
		if comp1 >= n:
			a = a - n
			n = 0
		else:
			a = a - comp1
			n = n - comp1
	else:
		a = temp1
		n = ntemp1
		if comp2 >= n:
			b = b - n
			n = 0
		else:
			b = b - comp2
			n = n - comp2
	print(a * b)


T = int(input())
ret = []
for t in range(T):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = max(a - n, x) * max(b - max(0, n - a + x), y)
	ans2 = max(b - n, y) * max(a - max(0, n - b + y), x)
	ret.append(min(ans1, ans2))
for t in range(T):
	print(ret[t])


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

def main():
	t = int(input())
	for i in range(t):
		(a, b, x, y, n) = map(int, input().split())
		(j, k) = (a - x, b - y)
		if j >= n and k >= n:
			print(min((a - n) * b, a * (b - n)))
		elif j >= n and k < n:
			print(min(b * (a - n), y * (a - (n - k))))
		elif j < n and k >= n:
			print(min(a * (b - n), x * (b - (n - j))))
		elif n >= j + k:
			print(x * y)
		else:
			print(min(x * (b - (n - j)), y * (a - (n - k))))
	return
main()


def takeinput(s):
	index = s.find(' ')
	if index != -1:
		temp = int(s[:index])
		s = s[index + 1:]
	else:
		temp = int(s)
	return (temp, s)
n = int(input())
string = []
for i in range(0, n, 1):
	string.append(input())
for i in range(0, n, 1):
	(num1, string[i]) = takeinput(string[i])
	(num2, string[i]) = takeinput(string[i])
	(min1, string[i]) = takeinput(string[i])
	(min2, string[i]) = takeinput(string[i])
	(dec, string[i]) = takeinput(string[i])
	num1t = num1
	num2t = num2
	if num1t - dec >= min1:
		num1t -= dec
	else:
		num1t = min1
	if num2t - dec >= min2:
		num2t -= dec
	else:
		num2t = min2
	if num1t <= num2t:
		if num1 - dec >= min1:
			num1 -= dec
			dec = 0
		else:
			dec = dec - (num1 - min1)
			num1 = min1
			if num2 - dec >= min2:
				num2 -= dec
				dec = 0
			else:
				num2 = min2
	elif num2 - dec >= min2:
		num2 -= dec
		dec = 0
	else:
		dec = dec - (num2 - min2)
		num2 = min2
		if num1 - dec >= min1:
			num1 -= dec
			dec = 0
		else:
			num1 = min1
	print(num1 * num2)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	l = [[a, x], [b, y]]
	r = [[a, x], [b, y]]
	r.reverse()
	temp = n
	for i in l:
		m = min(n, i[0] - i[1])
		n -= m
		i[0] -= m
	mi = l[0][0] * l[1][0]
	n = temp
	for j in r:
		m = min(n, j[0] - j[1])
		n -= m
		j[0] -= m
	mi = min(mi, r[0][0] * r[1][0])
	print(mi)


from sys import stdin, stdout
from math import gcd, sqrt, factorial, pi
from collections import deque, defaultdict
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7

def pro(a, b, x, y, n):
	m = max(x, a - n)
	n -= a - m
	a = m
	b = max(y, b - n)
	return a * b
for _ in range(I()):
	(a, b, x, y, n) = R()
	print(min(pro(a, b, x, y, n), pro(b, a, y, x, n)))


from sys import stdin
import math

def readline():
	return stdin.readline()

def solve(a, b, x, y, n):
	ax = a - x
	by = b - y
	a1 = a - min(ax, n)
	b1 = b - min(by, n)
	i = n
	if a1 < b1:
		a = a1
		i -= min(ax, n)
		b -= min(by, i)
	else:
		b = b1
		i -= min(by, n)
		a -= min(ax, i)
	return a * b
tests = int(readline())
for t in range(0, tests):
	(a, b, x, y, n) = list(map(int, readline().rstrip('\n').split(' ')))
	print(solve(a, b, x, y, n))


testcase = int(input())
for test in range(testcase):
	(a, b, c, d, n) = map(int, input().split())
	(at, bt, nt) = (a, b, n)
	res = -1
	if at - c >= n:
		at = at - n
		if res == -1 or at * b < res:
			res = at * b
	else:
		nt = nt - (a - c)
		if b - d >= nt:
			bt = bt - nt
			if res == -1 or c * bt < res:
				res = c * bt
		elif res == -1 or c * d < res:
			res = c * d
	if b - d >= n:
		b = b - n
		if res == -1 or a * b < res:
			res = a * b
	else:
		n = n - (b - d)
		if a - c >= n:
			a = a - n
			if res == -1 or a * d < res:
				res = a * d
		elif res == -1 or c * d < res:
			res = c * d
	print(res)


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	fd = a - x
	sd = b - y
	if fd + sd <= n:
		print(x * y)
	else:
		if a - n >= x:
			fp = (a - n) * b
		else:
			f = x
			s = b - (n - (a - x))
			fp = f * s
		if b - n >= y:
			sp = (b - n) * a
		else:
			f = y
			s = a - (n - (b - y))
			sp = f * s
		print(min(fp, sp))


t = int(input())
for k in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = float('inf')
	for i in range(2):
		ans = min(ans, (a - min(n, a - x)) * (b - min(n - min(n, a - x), b - y)))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


def g(a, b, x, y, n):
	c = min(a - x, n)
	a -= c
	n -= c
	c = min(b - y, n)
	b -= c
	return a * b
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(g(a, b, x, y, n), g(b, a, y, x, n)))


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	diffa = a - x
	diffb = b - y
	n1 = n
	a1 = a
	b1 = b
	if diffa >= n:
		a -= n
	else:
		a -= diffa
		n -= diffa
		if diffb >= n:
			b -= n
		else:
			b -= diffb
	val = a * b
	(n, a, b) = (n1, a1, b1)
	if diffb >= n:
		b -= n
	else:
		b -= diffb
		n -= diffb
		if diffa >= n:
			a -= n
		else:
			a -= diffa
	val1 = a * b
	print(min(val, val1))


t = int(input())
for case in range(t):
	(a, b, x, y, n) = input().split(' ')
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	if a < b:
		aux = a
		a = b
		b = aux
		aux = x
		x = y
		y = aux
	if n <= b - y:
		print(a * (b - n))
	else:
		n -= b - y
		if n <= a - x:
			bruh = y * (a - n)
			n += b - y
			if a - n >= x:
				print(min(bruh, b * (a - n)))
			else:
				n -= a - x
				if b - n > y:
					print(min(bruh, x * (b - n)))
				else:
					print(x * y)
		else:
			print(x * y)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	diff = a - x + (b - y)
	res = x * y
	if n >= diff:
		print(res)
	else:
		t_a = a
		t_b = b
		t_n = n
		ans1 = 0
		if t_n >= t_a - x:
			t_n -= t_a - x
			t_a = x
			if t_n > 0:
				t_b -= t_n
			ans1 = t_a * t_b
		else:
			t_a -= t_n
			ans1 = t_a * t_b
		t_a = a
		t_b = b
		t_n = n
		ans2 = 0
		if t_n >= t_b - y:
			t_n -= t_b - y
			t_b = y
			if t_n > 0:
				t_a -= t_n
			ans2 = t_a * t_b
		else:
			t_b -= t_n
			ans2 = t_a * t_b
		print(min(ans1, ans2))


import math
t = int(input())
print()
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	n1 = min(n, b - y)
	n2 = min(n - n1, a - x)
	n3 = min(n, a - x)
	n4 = min(n - n3, b - y)
	print(min((b - n1) * (a - n2), (a - n3) * (b - n4)))


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		lst = []
		p = n
		(a1, b1, x1, y1) = (a, b, x, y)
		if a - x >= p:
			a -= p
			lst.append(a * b)
		else:
			p -= a - x
			b -= p
			lst.append(b * x)
		if b1 - y >= n:
			b1 -= n
			lst.append(b1 * a1)
		else:
			n -= b1 - y
			a1 -= n
			lst.append(a1 * y)
		print(min(lst))


def process():
	(a, b, x, y, n) = list(map(int, input().split()))

	def get_min(n, a, b, x, y):
		da = min(n, a - x)
		(a, n) = (a - da, n - da)
		if n == 0:
			return a * b
		db = min(n, b - y)
		b = b - db
		return a * b
	return min(get_min(n, a, b, x, y), get_min(n, b, a, y, x))

def main():
	for i in range(int(input())):
		print(process())
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c = max(a - n, x)
	d = max(b - n, y)
	if c < d:
		ans = c
		n -= a - c
		d = max(b - n, y)
		print(ans * d)
	else:
		ans = d
		n -= b - d
		c = max(a - n, x)
		print(ans * c)


t = int(input())
for _ in range(t):
	inp = list(map(int, input().split()))
	a = inp[0]
	b = inp[1]
	x = inp[2]
	y = inp[3]
	n = inp[4]
	arr = []
	if a - n >= x:
		arr.append((a - n) * b)
	if b - n >= y:
		arr.append(a * (b - n))
	if a - x < n:
		k = n - (a - x)
		if b - k >= y:
			arr.append((b - k) * x)
		else:
			arr.append(x * y)
	if b - y < n:
		k = n - (b - y)
		if a - k >= x:
			arr.append((a - k) * y)
		else:
			arr.append(x * y)
	print(min(arr))


import sys
input = sys.stdin.readline
read = lambda : map(int, input().split())

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

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

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

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

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

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

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

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

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

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

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

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

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

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

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

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

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

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

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

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

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

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def solve():
	(a, b, x, y, n) = read()
	num1 = max(a - n, x)
	num2 = max(b - max(n - (a - num1), 0), y)
	prod1 = num1 * num2
	num1 = max(b - n, y)
	num2 = max(a - max(n - (b - num1), 0), x)
	prod2 = num1 * num2
	print(min(prod1, prod2))
for _ in range(int(input())):
	solve()


def minProduct(array):
	a = array[0]
	c = a
	b = array[1]
	d = b
	x = array[2]
	y = array[3]
	n = array[4]
	if a - x + (b - y) <= n:
		return x * y
	if a - x >= n:
		a = a - n
	else:
		b = b - (n - (a - x))
		a = x
	result1 = a * b
	if d - y >= n:
		d = d - n
	else:
		c = c - (n - (d - y))
		d = y
	result2 = c * d
	return min(result1, result2)
a = []
t = int(input())
for i in range(t):
	l = list(input().split(' '))
	l = [int(j) for j in l]
	a.append(minProduct(l))
for i in a:
	print(i)


t = int(input())
for x in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	a1 = a2 = a
	b1 = b2 = b
	x1 = x2 = x
	y1 = y2 = y
	n1 = n2 = n
	if a1 - x1 > n1:
		a1 -= n1
		n1 = 0
	else:
		n1 -= a1 - x1
		a1 = x1
	if b1 - y1 > n1:
		b1 -= n1
	else:
		b1 = y1
	if b2 - y2 > n2:
		b2 -= n2
		n2 = 0
	else:
		n2 -= b2 - y2
		b2 = y2
	if a2 - x2 > n2:
		a2 -= n2
	else:
		a2 = x2
	print(min(a1 * b1, a2 * b2))


import sys
import bisect
import math as mt
input = sys.stdin.readline
t = int(input())
mod = 10 ** 9 + 7
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, n1) = (a, b, n)
	if a > x:
		diff = a - x
		a -= min(diff, n)
		n -= min(diff, n)
	if b > y:
		diff = b - y
		b -= min(diff, n)
		n -= min(diff, n)
	ans = a * b
	(a, b, n) = (a1, b1, n1)
	if b > y:
		diff = b - y
		b -= min(diff, n)
		n -= min(diff, n)
	if a > x:
		diff = a - x
		a -= min(diff, n)
		n -= min(diff, n)
	print(min(a * b, ans))


h = int(input())
l = []
for i in range(h):
	(a, b, x, y, n) = list(map(int, input().split()))
	ans = 10 ** 18
	for i in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b) = (b, a)
		(x, y) = (y, x)
	l.append(ans)
for i in l:
	print(i)


for a0 in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	if a - x + b - y <= n:
		print(x * y)
	else:
		a1 = a2 = a
		b1 = b2 = b
		x1 = x2 = x
		y1 = y2 = y
		n1 = n2 = n
		ans1 = 0
		ans2 = 0
		r1 = min(a1 - x1, n1)
		n1 -= r1
		a1 -= r1
		b1 -= min(b1 - y1, n1)
		ans1 = a1 * b1
		r2 = min(b2 - y2, n2)
		n2 -= r2
		b2 -= r2
		a2 -= min(a2 - x2, n2)
		ans2 = a2 * b2
		print(min(ans1, ans2))


import sys
for _ in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	elif a == b:
		if x > y:
			(x, y) = (y, x)
	a1 = a
	b1 = b
	n1 = n
	if a - x > n:
		a -= n
		n = 0
	else:
		n -= a - x
		a = x
	if b - y > n:
		b -= n
		n = 0
	else:
		n -= b - y
		b = y
	ans1 = a * b
	if b1 - y > n1:
		b1 -= n1
		n1 = 0
	else:
		n1 -= b1 - y
		b1 = y
	if a1 - x > n1:
		a1 -= n1
		n1 = 0
	else:
		n1 -= a1 - x
		a1 = x
	ans2 = a1 * b1
	print(min(ans1, ans2))


def mia(a, b, x, y, n):
	p = 10 ** 18 + 1
	(n1, n2, n3) = (p, p, p)
	if a - x <= n:
		n = n - (a - x)
		a = x
		if b - y <= n:
			b = y
			n1 = a * b
		else:
			b = b - n
			n2 = a * b
	else:
		a = a - n
		n3 = a * b
	l = [n1, n2, n3]
	return min(l)
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	elif a == b:
		if x > y:
			(x, y) = (y, x)
	print(min(mia(a, b, x, y, n), mia(b, a, y, x, n)))


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


def solve(a, b, x, y, n):
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	if a == b and x > y:
		temp = x
		x = y
		y = temp
	diff_ax = abs(x - a)
	diff_by = abs(y - b)
	if a <= b:
		a = a - min(n, diff_ax)
		b = b - (n - min(n, diff_ax))
	else:
		b = b - min(n, diff_by)
		a = a - (n - min(n, diff_by))
	if a1 <= b1:
		b1 = b1 - min(n, diff_by)
		a1 = a1 - (n - min(n, diff_by))
	else:
		a1 = a1 - min(n, diff_ax)
		b1 = b1 - (n - min(n, diff_ax))
	a = max(a, x)
	b = max(b, y)
	a1 = max(a1, x)
	b1 = max(b1, y)
	print(min(a * b, a1 * b1))
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	solve(a, b, x, y, n)


from collections import deque
import sys
inf = float('inf')
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	n2 = n
	if a - x < n:
		first = x * max(y, b - (n - (a - x)))
	else:
		first = (a - n) * b
	if b - y < n:
		second = y * max(x, a - (n - (b - y)))
	else:
		second = (b - n) * a
	print(min(first, second))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = 0
	ans2 = 0
	a1 = a
	b1 = b
	n1 = n
	d = min(a - x, n)
	a -= d
	n -= d
	if n > 0:
		b -= min(b - y, n)
	ans1 = a * b
	d1 = min(b1 - y, n1)
	b1 -= d1
	n1 -= d1
	if n1 > 0:
		a1 -= min(a1 - x, n1)
	ans2 = a1 * b1
	print(min(ans1, ans2))


from sys import stdin
from math import ceil, gcd

def func():
	return
for _ in range(int(stdin.readline())):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	A1 = a - min(a - x, n)
	n1 = n - min(n, a - x)
	B1 = b - min(n1, b - y)
	B2 = b - min(b - y, n)
	n2 = n - min(n, b - y)
	A2 = a - min(n2, a - x)
	print(min(A1 * B1, A2 * B2))


t = int(input())
for i in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	n1 = n
	da = min(n, a - x)
	if da == n:
		a1 = a - n
		c = a1 * b
	else:
		a1 = x
		n = n - (a - x)
		db = min(n, b - y)
		b1 = b - db
		c = a1 * b1
	db = min(n1, b - y)
	if db == n1:
		b1 = b - n1
		c1 = b1 * a
	else:
		b1 = y
		n1 = n1 - (b - y)
		da = min(n1, a - x)
		a1 = a - da
		c1 = a1 * b1
	print(min(c, c1))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a + b - x - y <= n:
		print(x * y)
	else:
		if a - x >= n:
			t = (a - n) * b
		else:
			t = x * (b - (n - a + x))
		if b - y >= n:
			d = (b - n) * a
		else:
			d = y * (a - n + b - y)
		print(min(t, d))


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(p, q, z) = (a, b, n)
	p = max(x, p - z)
	z = z - (a - p)
	q = max(y, q - z)
	p1 = p * q
	(p, q, z) = (a, b, n)
	q = max(y, q - z)
	z = z - (b - q)
	p = max(x, p - z)
	p2 = p * q
	print(min(p1, p2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	cnt = 0
	m = a
	p = b
	o = n
	c = a - x
	if n > c:
		n -= c
		a -= c
		c = b - y
		if n > c:
			b -= c
		else:
			b -= n
	else:
		a -= n
	cnt = a * b
	(x, y) = (y, x)
	(a, b) = (p, m)
	n = o
	c = a - x
	if n > c:
		n -= c
		a -= c
		c = b - y
		if n > c:
			b -= c
		else:
			b -= n
	else:
		a -= n
	if a * b < cnt:
		print(a * b)
	else:
		print(cnt)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if x >= a - n:
		c1 = x * max(b - n + a - x, y)
	else:
		c1 = (a - n) * b
	if y >= b - n:
		c2 = y * max(a - n + b - y, x)
	else:
		c2 = (b - n) * a
	print(c1 if c1 <= c2 else c2)


ans = []
for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a == b:
		if x <= y:
			tmp = min(n, a - x)
			a -= tmp
			n -= tmp
			tmp = min(n, b - y)
			b -= tmp
			n -= tmp
		else:
			tmp = min(n, b - y)
			b -= tmp
			n -= tmp
			tmp = min(n, a - x)
			a -= tmp
			n -= tmp
	elif a - min(n, a - x) > b - min(n, b - y):
		tmp = min(n, b - y)
		b -= tmp
		n -= tmp
		tmp = min(n, a - x)
		a -= tmp
		n -= tmp
	else:
		tmp = min(n, a - x)
		a -= tmp
		n -= tmp
		tmp = min(n, b - y)
		b -= tmp
		n -= tmp
	ans += [a * b]
print(*ans, sep='\n')


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	da = min(n, a - x)
	db = min(n - da, b - y)
	ans = (a - da) * (b - db)
	t1 = a
	a = b
	b = t1
	t2 = x
	x = y
	y = t2
	da = min(n, a - x)
	db = min(n - da, b - y)
	ans = min(ans, (a - da) * (b - db))
	print(ans)


for _ in [0] * int(input()):
	(a, b, x, y, n) = map(int, input().split(' '))
	if a - x > n:
		k = (a - n) * b
	elif b - y > n - (a - x):
		k = x * (b - (n - (a - x)))
	else:
		k = x * y
	if b - y > n:
		p = (b - n) * a
	elif a - x > n - (b - y):
		p = y * (a - (n - (b - y)))
	else:
		p = x * y
	print(min(k, p))


def minimumProduct():
	for t in range(int(input())):
		(a, b, x, y, n) = map(int, input().split())
		(a2, b2, x2, y2, n2) = (a, b, x, y, n)
		if n > a - x:
			n = n - (a - x)
			a = x
			if n > b - y:
				b = y
			else:
				b = b - n
		else:
			a = a - n
			n = 0
		if n2 > b2 - y2:
			n2 = n2 - (b2 - y2)
			b2 = y2
			if n2 > a2 - x2:
				a2 = x2
			else:
				a2 = a2 - n2
		else:
			b2 = b2 - n2
			n2 = 0
		ans = min(a * b, a2 * b2)
		print(ans)
minimumProduct()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, n1) = (a, b, n)
	(p1, p2) = (0, 0)
	if a - x >= n:
		p1 = (a - n) * b
	else:
		n -= a - x
		b = max(b - n, y)
		p1 = x * b
	if b1 - y >= n1:
		p2 = (b1 - n1) * a1
	else:
		n1 -= b1 - y
		a1 = max(a1 - n1, x)
		p2 = y * a1
	print(min(p1, p2))


from math import ceil
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(p) for p in input().split()]
	if b > a:
		temp = a
		a = b
		b = temp
		temp = x
		x = y
		y = temp
	tempa = max(a - n, x)
	tempb = max(b - n, y)
	if tempa < tempb:
		n -= a - tempa
		a = tempa
		if n > 0:
			b = max(b - n, y)
			print(a * b)
		else:
			print(a * b)
	else:
		n -= b - tempb
		b = tempb
		if n > 0:
			a = max(a - n, x)
			print(a * b)
		else:
			print(a * b)


import sys
import collections as cc
import math as mt
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(a, b, x, y, n) = I()
	nn = n
	nnn = n
	now = max(x, a - n)
	difa = abs(now - a)
	nn -= difa
	noww = max(y, b - nn)
	nowb = max(y, b - n)
	difb = abs(b - nowb)
	nnn -= difb
	nowa = max(x, a - nnn)
	print(min(now * noww, nowa * nowb))


from math import ceil
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(a1, a2) = (a, a)
	(b1, b2) = (b, b)
	(n1, n2) = (n, n)
	m1 = min(a - x, n)
	a1 -= m1
	n1 -= m1
	b1 -= min(b - y, n1)
	ans1 = a1 * b1
	m2 = min(b - y, n)
	b2 -= m2
	n2 -= m2
	a2 -= min(a - x, n2)
	ans2 = a2 * b2
	print(min(ans1, ans2))


import sys
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split())
	if a - min(a - x, n) < b - min(b - y, n):
		(a, b) = (b, a)
		(x, y) = (y, x)
	d = min(b - y, n)
	b -= d
	n -= d
	a -= min(a - x, n)
	print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(c, d) = (a, b)
	if a > b:
		(c, d) = (b, a)
		(x, y) = (y, x)
	if a == b:
		if x < y:
			c = a
			d = b
		else:
			c = b
			d = a
			(x, y) = (y, x)
	op1 = max(x, c - n) * max(y, d - (n - min(c - x, n)))
	op2 = max(y, d - n) * max(x, c - (n - min(d - y, n)))
	print(min(op1, op2))


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


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(tempa, tempb, tempn) = (a, b, n)
	new_a = max(a - n, x)
	n -= a - new_a
	a = new_a
	if n > 0:
		b = max(b - n, y)
	x1 = a * b
	(a, b) = (tempa, tempb)
	n = tempn
	new_b = max(b - n, y)
	n -= b - new_b
	b = new_b
	if n > 0:
		a = max(a - n, x)
	x2 = a * b
	print(min(x1, x2))


import sys

def main():
	t = int(input())
	while t:
		(a, b, x, y, n) = map(int, input().split())
		if a + b - x - y <= n:
			print(x * y)
		else:
			ans1 = a - x
			ans2 = y + n - b
			a1 = min(ans1, ans2)
			a2 = max(ans1, ans2)
			if a1 < 0:
				a1 = 0
			if n - a2 < 0:
				a2 = n
			p1 = (a - a1) * (b - (n - a1))
			p2 = (a - a2) * (b - (n - a2))
			print(min(p1, p2))
		t -= 1
main()


def solve():
	(a, b, x, y, n) = map(int, input().split())
	p = a
	q = b
	tm = n
	res = 0
	j = max(a - tm, x)
	tm -= a - j
	k = max(b - tm, y)
	res = j * k
	j = max(b - n, y)
	n -= b - j
	k = max(a - n, x)
	res = min(res, j * k)
	print(res)
for _ in range(int(input())):
	solve()


t = int(input())
ans = ''
for _ in range(t):
	A = [int(i) for i in input().split()]
	a = A[0]
	b = A[1]
	x = A[2]
	y = A[3]
	n = A[4]
	u = a - x
	v = b - y
	if u >= n:
		a1 = a - n
		b1 = b
	else:
		a1 = x
		b1 = max(y, b + u - n)
	if v >= n:
		b2 = b - n
		a2 = a
	else:
		b2 = y
		a2 = max(x, a + v - n)
	ans += str(min(a1 * b1, a2 * b2)) + '\n'
print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if y > b - n:
		d = n - (b - y)
	else:
		d = 0
	b1 = max(y, b - n)
	a1 = max(x, a - d)
	if x > a - n:
		d = n - (a - x)
	else:
		d = 0
	a2 = max(x, a - n)
	b2 = max(y, b - d)
	print(min(a1 * b1, a2 * b2))


def sub(i, j, n):
	val = min(i - j, n)
	i -= val
	n -= val
	return (i, n)

def cal(a, b, x, y, n):
	(b, n) = sub(b, y, n)
	if n > 0:
		(a, n) = sub(a, x, n)
	return a * b
for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(cal(a, b, x, y, n), cal(b, a, y, x, n)))


t = int(input())
for _ in range(t):
	min_prod = float('inf')
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		candidates = []
		if a - x < n:
			candidates.append(x * (b - (n - (a - x))))
		else:
			candidates.append((a - n) * b)
		if b - y < n:
			candidates.append(y * (a - (n - (b - y))))
		else:
			candidates.append(a * (b - n))
		print(min(candidates))


import math

def sol1(a, b, x, y, n):
	t = min(a - x, n)
	a -= t
	n -= t
	t = min(b - y, n)
	b -= t
	n -= t
	return a * b

def sol2(a, b, x, y, n):
	t = min(b - y, n)
	b -= t
	n -= t
	t = min(a - x, n)
	a -= t
	n -= t
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if b > a:
		(a, b, x, y) = (b, a, y, x)
	print(min(sol1(a, b, x, y, n), sol2(a, b, x, y, n)))


for i in range(int(input())):
	(a, b, x, y, n) = [int(num) for num in input().split()]
	a1 = abs(a - x)
	a2 = a - min(a1, n)
	b1 = abs(b - y)
	b2 = b - min(b1, n)
	if n - a1 > 0:
		p = min(n - a1, b1)
		c1 = a2 * (b - p)
	else:
		c1 = a2 * b
	if n - b1 > 0:
		p1 = min(n - b1, a1)
		c2 = b2 * (a - p1)
	else:
		c2 = b2 * a
	if n % 2 == 0:
		count = 1
		a3 = a - min(a1, n // 2)
		b3 = b - min(b1, n // 2)
		c3 = a3 * b3
	else:
		count = 0
		a4 = a - min(a1, n // 2)
		b4 = b - min(b1, n // 2 + 1)
		c4 = a4 * b4
		a5 = a - min(a1, n // 2 + 1)
		b5 = b - min(b1, n // 2)
		c5 = a5 * b5
	if count == 1:
		ans = min(c1, c2, c3)
		print(ans)
	else:
		ans = min(c1, c2, c4, c5)
		print(ans)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	i = 0
	if a - min(a - x, n) < b - min(b - y, n):
		a1 = a
		a -= min(a - x, n)
		n -= min(a1 - x, n)
		if n == 0:
			print(a * b)
		else:
			b -= min(b - y, n)
			print(a * b)
	else:
		b1 = b
		b -= min(b - y, n)
		n -= min(b1 - y, n)
		if n == 0:
			print(a * b)
		else:
			a -= min(a - x, n)
			print(a * b)


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	(a, b, x, y, n) = map(int, input().split())
	n1 = a - x
	n2 = b - y
	if n1 >= n:
		ANS1 = (a - n) * b
	else:
		ANS1 = x * max(y, b - (n - n1))
	if n2 >= n:
		ANS2 = (b - n) * a
	else:
		ANS2 = y * max(x, a - (n - n2))
	print(min(ANS1, ANS2))


import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	n1 = n
	if a - x >= n:
		a = a - n
		m1 = a * b
	else:
		n -= a - x
		a = x
		if b - y >= n:
			b = b - n
			m1 = a * b
		else:
			n -= b - y
			b = y
			m1 = a * b
	a = b1
	b = a1
	temp = x
	x = y
	y = temp
	n = n1
	if a - x >= n:
		a = a - n
		m2 = a * b
	else:
		n -= a - x
		a = x
		if b - y >= n:
			b = b - n
			m2 = a * b
		else:
			n -= b - y
			b = y
			m2 = a * b
	print(min(m1, m2))


for k in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(v, u) = (0, 0)
	if a - x >= n:
		v = (a - n) * b
	else:
		v = x
		if b - y >= n - (a - x):
			v *= b - (n - (a - x))
		else:
			v *= y
	if b - y >= n:
		u = (b - n) * a
	else:
		u = y
		if a - x >= n - (b - y):
			u *= a - (n - (b - y))
		else:
			u *= x
	print(min(u, v))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = [int(j) for j in input().split()]
	dif1 = a - x
	dif2 = b - y
	ans = []
	if dif1 > n:
		ans.append((a - n) * b)
	else:
		temp = n - dif1
		if temp > dif2:
			ans.append(x * y)
		else:
			ans.append(x * (b - temp))
	if dif2 > n:
		ans.append((b - n) * a)
	else:
		temp = n - dif2
		if temp > dif1:
			ans.append(x * y)
		else:
			ans.append(y * (a - temp))
	print(min(ans))


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

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

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

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

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

def mod():
	return 10 ** 9 + 7
for i in range(INT()):
	(a, b, x, y, n) = MAP()
	c1 = a - x
	c2 = b - y
	if a - x + b - y <= n:
		print(x * y)
	elif a < b:
		if n > c1:
			ans1 = (a - c1) * (b - (n - c1))
			if c2 >= n:
				ans2 = (b - n) * a
			else:
				ans2 = (b - c2) * (a - (n - c2))
			ans = min(ans1, ans2)
			print(ans)
		else:
			a -= n
			print(a * b)
	elif n > c2:
		ans1 = (b - c2) * (a - (n - c2))
		if c1 >= n:
			ans2 = (a - n) * b
		else:
			ans2 = (a - c1) * (b - (n - c1))
		ans = min(ans1, ans2)
		print(ans)
	else:
		b -= n
		print(a * b)


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

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

def main():
	t = iin()
	while t:
		t -= 1
		(a, b, x, y, n) = lin()
		if max(x, a - n) < max(y, b - n):
			(a, b) = (b, a)
			(x, y) = (y, x)
		x1 = min(n, abs(b - y))
		b -= x1
		n -= x1
		x1 = min(n, abs(a - x))
		a -= x1
		n -= x1
		print(a * b)
main()


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())

	def solve(a, b, x, y, n):
		t = abs(x - a)
		if n >= t:
			a = a - t
			n -= t
		else:
			a -= n
			n = 0
		b = max(y, b - n)
		return a * b
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	d1 = a - x
	d2 = b - y
	if d1 + d2 <= n:
		print(x * y)
	elif d1 >= n and d2 >= n:
		print(min(b * (a - n), a * (b - n)))
	elif d1 >= n and d2 <= n:
		print(min(b * (a - n), y * (a - (n - d2))))
	elif d1 <= n and d2 >= n:
		print(min(a * (b - n), x * (b - (n - d1))))
	else:
		print(min((a - d1) * (b - (n - d1)), (b - d2) * (a - (n - d2))))


for i in range(int(input())):
	a = list(map(int, input().strip().split()))[:5]
	c = []
	d = 0
	e = 0
	if a[2] + a[4] <= a[0]:
		d = 1
		c.append((a[0] - a[4]) * a[1])
	if a[3] + a[4] <= a[1]:
		e = 1
		c.append((a[1] - a[4]) * a[0])
	if d != 1 and e != 1:
		r = a[1] - (a[4] - (a[0] - a[2]))
		if r < a[3]:
			r = a[3]
		c.append(r * a[2])
		t = a[0] - (a[4] - (a[1] - a[3]))
		if t < a[2]:
			t = a[2]
		c.append(t * a[3])
	if d == 1 and e != 1:
		r = a[0] - (a[4] - (a[1] - a[3]))
		if r < a[2]:
			r = a[2]
		c.append(r * a[3])
	if d != 1 and e == 1:
		r = a[1] - (a[4] - (a[0] - a[2]))
		if r < a[3]:
			r = a[3]
		c.append(r * a[2])
	print(min(c))


import sys
from collections import deque
input = sys.stdin.readline
T = int(input())
for i in range(T):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a - n if a - n >= x else x
	b1 = b - n if b - n >= y else y
	if a1 < b1:
		ra = a1
		rb = b - (n - (a - a1))
		if rb < y:
			rb = y
	else:
		rb = b1
		ra = a - (n - (b - b1))
		if ra < x:
			ra = x
	print(ra * rb)


T = int(input())
for t in range(T):
	(a, b, x, y, n) = [int(x) for x in input().strip().split(' ')]
	print(min((a - n) * b if a > x + n else x * max(y, b - (n - (a - x))), (b - n) * a if b > y + n else y * max(x, a - (n - (b - y)))))


T = int(input())
for t in range(T):
	(a, b, x, y, n) = map(int, input().split())
	if b > a:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if n >= a - x + b - y:
		ans = x * y
	else:
		mina = max(x, a - n)
		minb = max(y, b - n)
		ans = min(minb * max(x, a - (n - (b - minb))), mina * max(y, b - (n - (a - mina))))
	print(ans)


import math, queue, heapq
import sys
sys.setrecursionlimit(10 ** 6)
fastinput = sys.stdin.readline
fastout = sys.stdout.write
t = int(fastinput())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, fastinput().split())
	if max(a - n, x) < max(b - n, y):
		req = a - x
		if req > n:
			print((a - n) * b)
		else:
			print(x * max(y, b - (n - req)))
	else:
		req = b - y
		if req > n:
			print((b - n) * a)
		else:
			print(y * max(x, a - (n - req)))


import sys
import math
t = int(input())
for j in range(t):
	(a, b, x, y, n) = map(int, input().split())
	left = max(a - n, x)
	right = max(b - n, y)
	if left <= right:
		fina = max(a - n, x)
		n = n - (a - fina)
		finb = max(b - n, y)
		ans = fina * finb
		print(ans)
	else:
		finb = max(b - n, y)
		n = n - (b - finb)
		fina = max(a - n, x)
		ans = fina * finb
		print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	n_cop = n
	pos = []
	(a_1, b_1) = (a, b)
	k = min(a_1 - x, n)
	a_1 -= k
	n -= k
	k = min(b_1 - y, n)
	b_1 -= k
	n -= k
	pos.append(a_1 * b_1)
	n = n_cop
	(a_2, b_2) = (a, b)
	k = min(b_2 - y, n)
	b_2 -= k
	n -= k
	k = min(a_2 - x, n)
	a_2 -= k
	n -= k
	pos.append(a_2 * b_2)
	print(min(pos))


for _ in range(int(input())):
	(a, b, min_a, min_b, decrease) = map(int, input().split())
	if a == b:
		if min_a < min_b:
			decr = min(decrease, a - min_a)
			a -= decr
			decrease -= decr
		else:
			decr = min(decrease, b - min_b)
			b -= decr
			decrease -= decr
	elif a - min(decrease, a - min_a) < b - min(decrease, b - min_b):
		decr = min(decrease, a - min_a)
		a -= decr
		decrease -= decr
	else:
		decr = min(decrease, b - min_b)
		b -= decr
		decrease -= decr
	if decrease > 0:
		decr = min(decrease, a - min_a)
		a -= decr
		decrease -= decr
	if decrease > 0:
		decr = min(decrease, b - min_b)
		b -= decr
		decrease -= decr
	print(a * b)


import sys
for i in range(int(input())):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split())
	if a - n >= x:
		maxone = (a - n) * b
	elif a - n < x:
		if a - x + (b - y) >= n:
			maxone = x * (b - (n - (a - x)))
		else:
			maxone = x * y
	if b - n >= y:
		maxtwo = (b - n) * a
	elif b - n < y:
		if b - y + (a - x) >= n:
			maxtwo = y * (a - (n - (b - y)))
		else:
			maxtwo = x * y
	print(min(maxone, maxtwo))


import sys
input = sys.stdin.readline
t = int(input())
for case in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if max(x, a - n) > max(y, b - n):
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a - n < x:
		n -= a - x
		a = x
		b -= n
		b = max(b, y)
		print(a * b)
	else:
		a -= n
		print(a * b)


k = int(input())
for _ in range(k):
	(a, b, x, y, n) = map(int, input().strip().split(' '))
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	elif b == a:
		if x > y:
			(a, b) = (b, a)
			(x, y) = (y, x)
	t1 = max(a - n, x)
	t2 = max(b - n, y)
	if t1 > t2:
		a = max(a - n + b - t2, x)
		print(a * t2)
	else:
		b = max(b - n + a - t1, y)
		print(b * t1)


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

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

	def In():
		return map(int, input().split())
else:

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

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

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def solve(a, b, x, y, n):
	temp = min(b - y, n)
	b -= temp
	n -= temp
	temp = min(a - x, n)
	a -= temp
	n -= temp
	return a * b

def main():
	try:
		(a, b, x, y, n) = In()
		temp2 = solve(a, b, x, y, n)
		temp = min(a - x, n)
		a -= temp
		n -= temp
		temp = min(b - y, n)
		b -= temp
		n -= temp
		temp1 = a * b
		print(min(temp1, temp2))
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	q = a - x
	w = b - y
	e = a - n
	r = b - n
	if e > x:
		e = e
	else:
		e = x
	if r > y:
		r = r
	else:
		r = y
	if e <= r:
		if q >= n:
			print((a - n) * b)
		elif n - q >= w:
			print(x * y)
		else:
			print(x * (b - (n - q)))
	elif w >= n:
		print((b - n) * a)
	elif n - w >= q:
		print(x * y)
	else:
		print(y * (a - (n - w)))


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	da = min(n, a - x)
	db = min(n - da, b - y)
	c = (a - da) * (b - db)
	da = min(n, b - y)
	db = min(n - da, a - x)
	d = (b - da) * (a - db)
	print(min(c, d))


for i in range(int(input())):
	(a, b, c, d, e) = map(int, input().split())
	A = a
	B = b
	E = e
	if a - e >= c:
		a -= e
	else:
		e = e - (a - c)
		a = c
		if b - e >= d:
			b -= e
		else:
			b = d
	if B - E >= d:
		B -= E
	else:
		E -= B - d
		B = d
		if A - E >= c:
			A -= E
		else:
			A = c
	print(min(a * b, A * B))


def find(a, b, x, y, n):
	req = a - x
	min_val = min(req, n)
	a -= min_val
	n -= min_val
	b -= n
	return a * b

def solve(a, b, x, y, n, ans):
	req1 = a - x
	req2 = b - y
	if req1 + req2 <= n:
		a = x
		b = y
		ans.append(str(a * b))
	else:
		min_val = find(a, b, x, y, n)
		min_val = min(min_val, find(b, a, y, x, n))
		ans.append(str(min_val))

def main():
	t = int(input())
	ans = []
	for i in range(t):
		(a, b, x, y, n) = list(map(int, input().split()))
		solve(a, b, x, y, n, ans)
	print('\n'.join(ans))
main()


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a <= b:
		if a - n >= x:
			print((a - n) * b)
			continue
		else:
			var = n - (a - x)
			if b - var >= y:
				ans1 = x * (b - var)
			else:
				ans1 = x * y
			if b - n >= y:
				ans2 = a * (b - n)
			else:
				var = n - (b - y)
				if a - var >= x:
					ans2 = y * (a - var)
				else:
					ans2 = y * x
			print(min(ans1, ans2))


t = int(input(''))
while t:
	elements = input('')
	elements = elements.split()
	lst = []
	lst1 = []
	for element in elements:
		lst.append(int(element))
		lst1.append(int(element))
	if abs(lst[0] - lst[2]) >= lst[4]:
		lst[0] -= lst[4]
	else:
		k = abs(lst[0] - lst[2])
		lst[0] -= k
		lst[4] -= k
		l = abs(lst[1] - lst[3])
		if l >= lst[4]:
			lst[1] -= lst[4]
		else:
			lst[1] -= l
	m = lst[0] * lst[1]
	if abs(lst1[1] - lst1[3]) >= lst1[4]:
		lst1[1] -= lst1[4]
	else:
		k = abs(lst1[1] - lst1[3])
		lst1[1] -= k
		lst1[4] -= k
		l = abs(lst1[0] - lst1[2])
		if l >= lst1[4]:
			lst1[0] -= lst1[4]
		else:
			lst1[0] -= l
	n = lst1[0] * lst1[1]
	if m < n:
		print(m)
	else:
		print(n)
	t -= 1


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)

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

def inps():
	return input().rstrip()

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

def _debug(obj):
	print(obj, file=sys.stderr)
loop = inp()
for _ in range(loop):
	(a, b, x, y, n) = inpl()
	a1 = max(a - n, x)
	b1 = max(y, b - (n - (a - a1)))
	b2 = max(b - n, y)
	a2 = max(x, a - (n - (b - b2)))
	print(min(a1 * b1, a2 * b2))


for j in range(int(input())):
	name = [int(i) for i in input().split()]
	m = name[4]
	p = max(name[2], name[0] - m)
	m -= name[0] - p
	a1 = max(name[3], name[1] - m) * p
	m = name[4]
	r = max(name[3], name[1] - m)
	m -= name[1] - r
	a2 = max(name[2], name[0] - m) * r
	print(min(a1, a2))


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().rstrip().split())
inl = lambda : list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
ans = []
t = ini()
for _ in range(t):
	(a, b, x, y, n) = inm()
	tmpa = min(b - y, n)
	tmpb = min(a - x, n)
	ans.append(min((b - tmpa) * (a - min(a - x, n - tmpa)), (a - tmpb) * (b - min(b - y, n - tmpb))))
out(ans)


import math
t = int(input())

def g1(a, b, x, y, n):
	temp = b - n
	if temp >= y:
		return a * temp
	else:
		temp = b
		b = y
		n -= temp - y
		if a - n >= x:
			a -= n
		else:
			a = x
		return a * b

def g2(a, b, x, y, n):
	temp = a - n
	if temp >= x:
		return b * temp
	else:
		temp = a
		a = x
		n -= temp - x
		if b - n >= y:
			b -= n
		else:
			b = y
		return a * b
for _ in range(t):
	(a, b, x, y, n) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	c = g1(a, b, x, y, n)
	d = g2(a, b, x, y, n)
	if c > d:
		print(d)
	else:
		print(c)


def calc(a, b, x, y, n):
	d = min(n, a - x)
	a = a - d
	n = n - d
	d = min(n, b - y)
	b = b - d
	return a * b
N = int(input())
for n in range(N):
	(a, b, x, y, n) = list(map(int, input().split()))
	v1 = calc(a, b, x, y, n)
	v2 = calc(b, a, y, x, n)
	print(min(v1, v2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	min_a = max(a - n, x)
	min_b = max(b - n, y)
	n_a = max(n - (a - x), 0)
	n_b = max(n - (b - y), 0)
	b_if_min_a = max(b - n_a, y)
	a_if_min_b = max(a - n_b, x)
	min_prod = min(min_a * b_if_min_a, min_b * a_if_min_b)
	print(min_prod)


for _ in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	if a - x + b - y > n:
		if a - x >= n:
			sub1 = (a - n) * b
		else:
			sub1 = x * (b - (n - (a - x)))
		if b - y >= n:
			sub2 = a * (b - n)
		else:
			sub2 = (a - (n - (b - y))) * y
		print(min([sub1, sub2]))
	else:
		print(x * y)


testList = []
for i in range(int(input())):
	testList.append([int(num) for num in input().split()])
for i in testList:
	if i[0] - i[2] > i[4]:
		min0 = i[0] - i[4]
	else:
		min0 = i[2]
	if i[1] - i[3] > i[4]:
		min1 = i[1] - i[4]
	else:
		min1 = i[3]
	if min0 < min1:
		(choose1, choose2) = (0, 1)
	else:
		(choose1, choose2) = (1, 0)
	if i[4] > i[choose1] - i[choose1 + 2]:
		i[4] -= i[choose1] - i[choose1 + 2]
		i[choose1] = i[choose1 + 2]
		if i[4] > i[choose2] - i[choose2 + 2]:
			i[choose2] = i[choose2 + 2]
		else:
			i[choose2] -= i[4]
	else:
		i[choose1] -= i[4]
	print(i[choose1] * i[choose2])


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, n1) = (a, b, n)
	temp1 = 10 ** 18
	temp = a - x
	if n >= temp:
		a = x
		n -= temp
		temp2 = b - y
		if n > temp2:
			b = y
			temp1 = min(temp1, a * b)
		else:
			b -= n
			temp1 = min(temp1, a * b)
	elif temp > n:
		a -= n
		temp1 = min(temp1, a * b)
	(a, b, n) = (a1, b1, n1)
	temp = b - y
	if n >= temp:
		b = y
		n -= temp
		temp2 = a - x
		if n > temp2:
			a = x
			temp1 = min(temp1, a * b)
		else:
			a -= n
			temp1 = min(temp1, a * b)
	elif temp > n:
		b -= n
		temp1 = min(temp1, a * b)
	print(temp1)
	t -= 1


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans

def do(a, b, x, y, n):
	d = min(a - x, n)
	a -= d
	n -= d
	b = max(b - n, y)
	return a * b
t = int(input())
for tt in range(t):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split(' '))
	print(min(do(a, b, x, y, n), do(b, a, y, x, n)))
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


rw = int(input())
for wewq in range(rw):
	(a, b, x, y, n) = map(int, input().split())
	da = a - x
	db = b - y
	if da + db <= n:
		print(x * y)
	else:
		an = a - min(da, n)
		bn = b - min(db, n)
		if an <= bn:
			b -= n - (a - an)
			print(an * b)
		else:
			a -= n - (b - bn)
			print(bn * a)


T = int(input())
for t in range(T):
	ab = list(map(int, input().split()))
	a = ab[0]
	b = ab[1]
	x = ab[2]
	y = ab[3]
	n = ab[4]
	if n >= a - x + b - y:
		a = x
		b = y
		print(a * b)
		continue
	a1 = a
	b1 = b
	n1 = n
	if b - y >= n:
		b -= n
		n = 0
	else:
		n -= b - y
		b = y
		a -= min(n, a - x)
	if a1 - x >= n1:
		a1 -= n1
		n1 = 0
	else:
		n1 -= a1 - x
		a1 = x
		b1 -= min(n1, b1 - y)
	print(min(a * b, a1 * b1))


import math

def ok(a, b, x, y, n):
	d1 = a - x
	d2 = b - y
	m = min(d1, n)
	a -= m
	n -= m
	c1 = a * b
	m1 = min(d2, n)
	b -= m1
	n -= m1
	c = a * b
	return c
tt = int(input())
while tt:
	tt -= 1
	ll = list(map(int, input().split()))
	a = ll[0]
	b = ll[1]
	x = ll[2]
	y = ll[3]
	n = ll[4]
	print(min(ok(a, b, x, y, n), ok(b, a, y, x, n)))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	ans = a * b
	ck = min(a - x, n)
	ca = a - ck
	cn = n - ck
	cb = b - min(b - y, cn)
	ans = min(ans, ca * cb)
	ck = min(b - y, n)
	cb = b - ck
	cn = n - ck
	ca = a - min(a - x, cn)
	ans = min(ans, ca * cb)
	print(ans)


from sys import stdin, stdout, setrecursionlimit
import heapq
from math import gcd, ceil, sqrt
from collections import Counter, deque
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
setrecursionlimit(100000)
mod = 1000000007

def do(a, b, x, y, n):
	diffa = a - x
	diffb = b - y
	cur = min(diffa, n)
	n -= cur
	a -= cur
	b -= min(diffb, n)
	return a * b
tc = ii1()
for _ in range(tc):
	(a, b, x, y, n) = iia()
	res1 = do(a, b, x, y, n)
	res2 = do(b, a, y, x, n)
	print(min(res1, res2))


def do_op(a, b, x, y, n):
	if b - y >= n:
		return a * (b - n)
	else:
		n -= b - y
		if a - x >= n:
			return (a - n) * y
		else:
			return x * y

def main(a, b, x, y, n):
	val1 = do_op(a, b, x, y, n)
	val2 = do_op(b, a, y, x, n)
	return min(val1, val2)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	val = main(a, b, x, y, n)
	print(val)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split(' ')]
	r = max(y, b - n)
	rem = max(0, y - (b - n))
	l = max(x, a - rem)
	p1 = l * r
	(a, b, x, y) = (b, a, y, x)
	r = max(y, b - n)
	rem = max(0, y - (b - n))
	l = max(x, a - rem)
	p2 = l * r
	print(min(p1, p2))


def calc(a, b, x, y, n):
	a1 = max(a - n, x)
	n -= a - a1
	b1 = max(b - n, y)
	return a1 * b1

def solve(a, b, x, y, n):
	return min(calc(a, b, x, y, n), calc(b, a, y, x, n))

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


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if x < y:
		temp = x
		x = y
		y = temp
		temp = a
		a = b
		b = temp
	nx = a - x
	ny = b - y
	if ny <= n:
		n = n - ny
		if n > nx:
			n = nx
		print(y * (a - n))
	else:
		n1 = n
		if n > nx:
			n1 = nx
		if a - n1 > b - n:
			print(a * (b - n))
		else:
			print((a - n1) * (b - n + n1))


from math import inf
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	t = min(b - y, n)
	p1 = (b - t) * max(a - (n - t), x)
	t = min(a - x, n)
	p2 = (a - t) * max(b - (n - t), y)
	print(min(p1, p2))


T = int(input())
for t in range(T):
	(a, b, x, y, n) = [int(i) for i in input().split(' ')]
	if max(a - n, x) < max(b - n, y):
		to_decrease_a = min(a - x, n)
		to_decrease_b = n - to_decrease_a
	else:
		to_decrease_b = min(b - y, n)
		to_decrease_a = n - to_decrease_b
	new_a = max(a - to_decrease_a, x)
	new_b = max(b - to_decrease_b, y)
	print(new_a * new_b)


from math import *
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	r = n
	k = max(y, b - r)
	r = r - b + k
	m = max(x, a - r)
	ans = k * m
	c = max(x, a - n)
	n = n - a + c
	d = max(y, b - n)
	s = c * d
	ans = min(ans, s)
	print(ans)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	d1 = min(a - x, n)
	d2 = min(b - y, n - d1)
	ans1 = (a - d1) * (b - d2)
	d11 = min(b - y, n)
	d22 = min(a - x, n - d11)
	ans2 = (b - d11) * (a - d22)
	print(min(ans1, ans2))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	c = a - min(n, a - x)
	d = b - min(n, b - y)
	if c < d:
		b = max(b - (n - (a - c)), y)
		a = c
	else:
		a = max(a - (n - (b - d)), x)
		b = d
	print(a * b)


def f(a, b, x, y, n):
	z = a - x
	a -= min(z, n)
	n -= min(z, n)
	z = b - y
	b -= min(z, n)
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(f(a, b, x, y, n), f(b, a, y, x, n)))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	a1 = a
	b1 = b
	n1 = n
	a1 = max(a1 - n1, x)
	n1 -= abs(a - a1)
	b1 = max(b1 - n1, y)
	n1 -= abs(b - b1)
	ans = a1 * b1
	a1 = a
	b1 = b
	n1 = n
	b1 = max(b1 - n1, y)
	n1 -= abs(b - b1)
	a1 = max(a1 - n1, x)
	n1 -= abs(a - a1)
	ans = min(a1 * b1, ans)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if n >= a - x + (b - y):
		print(x * y)
	else:
		ax = a - x
		by = b - y
		if n >= ax:
			pp = x * (b - n + ax)
		else:
			pp = (a - n) * b
		if n >= by:
			ppp = y * (a - n + by)
		else:
			ppp = (b - n) * a
		print(min(pp, ppp))


def unequal(a, b, x, y, n):
	if a < b:
		if a - n >= x:
			a = a - n
		elif x <= b - n:
			b = b - (n - (a - x))
			if b >= y:
				a = x
			else:
				b = y
				a = x
		elif b - n >= y:
			b = b - n
		elif x <= y:
			b = b - (n - (a - x))
			if b >= y:
				a = x
			else:
				a = x
				b = y
		else:
			a = a - (n - (b - y))
			if a >= x:
				b = y
			else:
				a = x
				b = y
	print(a * b)

def equal(a, b, x, y, n):
	if a - n >= x:
		a = a - n
	elif b - n >= y:
		b = b - n
	elif x <= y:
		b = b - (n - (a - x))
		if b >= y:
			a = x
		else:
			b = y
			a = x
	else:
		a = a - (n - (b - y))
		if a >= x:
			b = y
		else:
			a = x
			b = y
	print(a * b)
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a < b:
		unequal(a, b, x, y, n)
	elif b < a:
		unequal(b, a, y, x, n)
	else:
		equal(a, b, x, y, n)


import random

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

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if -x + a - y + b <= n:
		print(x * y)
	else:
		mina = max(x, a - n)
		minb = max(y, b - n)
		if mina <= minb:
			n -= a - mina
			a = mina
			b = max(b - n, y)
		else:
			n -= b - minb
			b = minb
			a = max(a - n, x)
		print(a * b)


def ans(l, s, c1, c2, n):
	t = min(n, l - c1)
	l -= t
	n -= t
	t = min(n, s - c2)
	s -= t
	n -= t
	return l * s
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(ans(a, b, x, y, n), ans(b, a, y, x, n)))


from math import *
from bisect import *
from collections import *
from decimal import *

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

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

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

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	(a, b, x, y, n) = ma()
	r = float('inf')
	va = min(a - x, n)
	ta = a - va
	tb = b - min(n - va, b - y)
	r = min(r, ta * tb)
	va = min(b - y, n)
	tb = b - va
	ta = a - min(n - va, a - x)
	r = min(r, ta * tb)
	print(r)


def minDistribute(a, b, x, y, n):
	even = False if n % 2 != 0 else True
	if a - x > b - y:
		(a, b) = (b, a)
		(x, y) = (y, x)
	a = a - n // 2
	diff_a = a - x
	min_a = max(a, x)
	b = b - n // 2
	diff_b = b - y
	min_b = max(b, y)
	if diff_a < 0:
		b -= diff_a * -1
		min_b = max(b, y)
	if even:
		return min_a * min_b
	else:
		if a > b:
			a -= 1
			min_a = max(a, x)
		else:
			b -= 1
			min_b = max(b, y)
		return min_a * min_b

def solve1(a, b, x, y, n):
	a -= n
	diff_a = a - x
	min_a = max(a, x)
	min_b = b
	if diff_a < 0:
		b -= diff_a * -1
		min_b = max(b, y)
	return min_b * min_a
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = solve1(a, b, x, y, n)
	ans2 = solve1(b, a, y, x, n)
	print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	tmp_a = max(a - n, x)
	if a - n > x:
		tmp_b = b
	else:
		tmp_b = max(b - (n - (a - x)), y)
	result_a = tmp_a * tmp_b
	tmp_b = max(b - n, y)
	if b - n > y:
		tmp_a = a
	else:
		tmp_a = max(a - (n - (b - y)), x)
	result_b = tmp_a * tmp_b
	print(result_b if result_b < result_a else result_a)


import math
import sys
t = int(input())
for cs in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(aa, bb, xx, yy, nn) = (a, b, x, y, n)
	aa -= nn
	if aa < xx:
		nn = xx - aa
		aa = xx
		bb -= nn
		if bb < yy:
			bb = yy
	ans = aa * bb
	b -= n
	if b < y:
		n = y - b
		b = y
		a -= n
		if a < x:
			a = x
	ans = min(ans, a * b)
	print(ans)


for t in range(int(input())):
	(a, b, x, y, n) = [int(k) for k in input().split()]
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	adiff = min(a - x, n)
	bdiff = min(b - y, n)
	a1 = a
	a2 = a
	b1 = b
	b2 = b
	n1 = n
	n2 = n
	a1 -= adiff
	n1 -= adiff
	if n1 > 0:
		b1 -= min(n1, b1 - y)
	ans1 = a1 * b1
	b2 -= bdiff
	n2 -= bdiff
	if n2 > 0:
		a2 -= min(n2, a2 - x)
	ans2 = a2 * b2
	print(min(ans1, ans2))


def fun(a, b, x, y, n):
	t = min(n, a - x)
	a = a - t
	n = n - t
	t = min(n, b - y)
	b = b - t
	return a * b
t = int(input())
while t > 0:
	(a, b, x, y, n) = [int(x) for x in input().split()]
	r1 = fun(a, b, x, y, n)
	r2 = fun(b, a, y, x, n)
	print(min(r1, r2))
	t -= 1


t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	if y > x:
		(x, y) = (y, x)
		(a, b) = (b, a)
	k1 = a - x
	k2 = b - y
	if n >= k1 + k2:
		print(x * y)
	else:
		m1 = 1
		m2 = 1
		if x >= y:
			if a > b:
				if b - n > y:
					m1 = a
					m2 = b - n
				else:
					m2 = y
					if a - (y - (b - n)) < x:
						m1 = x
					else:
						m1 = a - (y - (b - n))
			elif n >= b - y:
				m2 = y
				m1 = a - (n - (b - y))
				if m1 < x:
					m1 = x
			elif b - n < x:
				m2 = b - n
				m1 = a
			elif n > a - x:
				m1 = x
				m2 = b - (n - (a - x))
			else:
				m1 = a - n
				m2 = b
		print(m1 * m2)
	t -= 1


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if b - y + (a - x) <= n:
		print(x * y)
		continue
	new_a = a - min(a - x, n)
	new_b = b - min(b - y, n)
	if new_a < new_b:
		n = n - (a - new_a)
		b -= min(b - y, n)
		print(new_a * b)
	else:
		n -= b - new_b
		a -= min(a - x, n)
		print(new_b * a)


def kek():
	string = input()
	(a, b, x, y, n) = list(map(int, string.split()))
	min_func = 100000000000000000000000000
	if a - x > n:
		new_a = a - n
		func = new_a * b
	else:
		new_a = x
		shagi = a - x
		if b - y > n - shagi:
			func = new_a * (b - (n - shagi))
		else:
			func = new_a * y
	if b - y > n:
		new_b = b - n
		func_2 = new_b * a
	else:
		new_b = y
		shagi = b - y
		if a - x > n - shagi:
			func_2 = new_b * (a - (n - shagi))
		else:
			func_2 = new_b * x
	print(min(func, func_2))
t = int(input())
for i in range(t):
	kek()


n = int(input())
l = []
for i in range(n):
	(a, b, x, y, n2) = [int(c) for c in input().split()]
	old_a = a
	old_b = b
	if max(a - n2, x) < max(b - n2, y):
		a -= min(abs(a - x), n2)
		n2 -= min(abs(old_a - x), n2)
		if n2 > 0:
			b -= min(abs(b - y), n2)
	else:
		b -= min(abs(b - y), n2)
		n2 -= min(abs(old_b - y), n2)
		if n2 > 0:
			a -= min(abs(a - x), n2)
	l.append(a * b)
for i in l:
	print(i)


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
for _ in range(int(I1())):
	(a, b, x, y, n) = I()
	(da, db) = (a - x, b - y)
	(min_a, min_b) = (a - min(n, da), b - min(n, db))
	if min_a < min_b:
		fa = min_a
		n -= min(n, da)
		fb = b - min(n, db)
		p = fa * fb
	else:
		fb = min_b
		n -= min(n, db)
		fa = a - min(n, da)
		p = fa * fb
	print(p)


def solve():
	inp = input().split()
	for i in range(len(inp)):
		inp[i] = int(inp[i])
	(a, b, x, y, n) = (inp[0], inp[1], inp[2], inp[3], inp[4])
	if a - x + b - y <= n:
		return x * y
	if max(a - n, x) > max(b - n, y):
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a - n >= x:
		return (a - n) * b
	else:
		return x * (b - (n - (a - x)))
t = int(input())
for i in range(t):
	print(solve())


import sys, bisect
from sys import stdin, stdout
from bisect import bisect_left, bisect_right, bisect, insort, insort_left, insort_right
from math import gcd, ceil, floor, sqrt
from collections import Counter, defaultdict, deque, OrderedDict
from queue import Queue, PriorityQueue
from string import ascii_lowercase
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 998244353
mod = 10 ** 9 + 7

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, ceil(sqrt(n)) + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

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

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

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

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

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

def solve():
	(a, b, x, y, n) = mp()
	X = a - x
	Y = b - y
	cp = n
	XX = a
	YY = b
	Z = max(X, Y)
	if Z == X:
		c = min(n, X)
		n -= c
		a -= c
		d = min(n, Y)
		n -= d
		b -= d
		c = min(cp, YY - y)
		cp -= c
		YY -= c
		d = min(cp, XX - x)
		cp -= d
		XX -= d
		print(min(a * b, XX * YY))
	else:
		c = min(n, Y)
		n -= c
		b -= c
		d = min(n, X)
		n -= d
		a -= d
		c = min(cp, XX - x)
		cp -= c
		XX -= c
		d = min(cp, YY - y)
		cp -= d
		YY -= d
		print(min(a * b, XX * YY))
for _ in range(inp()):
	solve()


import math

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

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

def solution(a, b, x, y, n):
	(ma, mb) = (max(x, a - n), max(y, b - n))
	if ma < mb:
		n = n - (a - ma)
		a = ma
		b = max(y, b - n)
	else:
		n = n - (b - mb)
		b = mb
		a = max(x, a - n)
	return a * b
t = inp()
result = []
while t:
	t -= 1
	(a, b, x, y, n) = inlt()
	result.append(solution(a, b, x, y, n))
for r in result:
	print(r)


for i in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(s, m) = (min(a, b), max(a, b))
	if s == a:
		l = x
	else:
		l = y
	if m == a:
		u = x
	else:
		u = y
	if s == m:
		if s - x + (s - y) <= n:
			print(x * y)
		elif s - min(x, y) < n:
			print(min(x, y) * (s - (n - (s - min(x, y)))))
		else:
			print((s - n) * s)
	elif s - l >= n:
		print((s - n) * m)
	else:
		if m - u <= n - (s - l):
			m1 = u
		else:
			m1 = m - (n - (s - l))
		if m - u > n:
			m2 = m - n
			m3 = s
		else:
			m2 = u
			if n - (m - m2) >= s - l:
				m3 = l
			else:
				m3 = s - (n - (m - m2))
		print(min(l * m1, m2 * m3))


t = int(input())
for ex in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	m = min(a - n, x, b - n, y)
	if a <= b and x <= max(b - n, y):
		a1 = max(x, a - n)
		b1 = max(y, b - (n - (a - a1)))
	elif b <= a and y <= max(a - n, x):
		b1 = max(y, b - n)
		a1 = max(x, a - (n - (b - b1)))
	elif x >= max(b - n, y):
		b1 = max(y, b - n)
		a1 = max(x, a - (n - (b - b1)))
	elif y >= max(a - n, x):
		a1 = max(x, a - n)
		b1 = max(y, b - (n - (a - a1)))
	print(a1 * b1)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x == n:
		a1 = x * b
	elif a - x < n:
		a1 = x * (b - min(n - a + x, b - y))
	else:
		a1 = (a - n) * b
	if b - y == n:
		a2 = y * a
	elif b - y < n:
		a2 = y * (a - min(n - b + y, a - x))
	else:
		a2 = (b - n) * a
	print(min(a1, a2))


import math
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	if max(a - n, x) < max(b - n, y):
		(a, b) = (b, a)
		(x, y) = (y, x)
	if b - y >= n:
		ans = a * (b - n)
		print(ans)
	else:
		n = n - (b - y)
		b = y
		a = a - n
		a = max(a, x)
		ans = a * b
		print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(e, f, g, h, k) = (a, b, x, y, n)
	q = min(k, f - h)
	f -= q
	k -= q
	p = min(k, e - g)
	bhu = p
	nhy = p
	e -= p
	k -= p
	j = 0
	al = k
	pq = n
	xy = 0
	tu = 0
	kj = n
	p = min(n, a - x)
	a -= p
	n -= p
	q = min(n, b - y)
	b -= q
	kjh = 0
	n = 0
	print(min(a * b, e * f))


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = 10 ** 9 + 7

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

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

def primeFactors(n):
	factors = defaultdict(int)
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors[i] += 1
			n //= i
		i += 1
	if n > 1:
		factors[n] += 1
	return factors

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

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

def a():
	(a, b) = map(int, input().split())
	ans = math.ceil(abs(b - a) / 10)
	print(ans)

def b():
	(a, b, x, y, n) = vars()
	(n1, n2) = (n, n)
	a1 = a - min(a - x, n)
	b2 = b - min(b - y, n)
	n1 -= a - a1
	n2 -= b - b2
	b1 = b - min(b - y, n1)
	a2 = a - min(a - x, n2)
	print(min(a1 * b1, a2 * b2))

def c():
	(n, x, y) = vars()
	diff = None
	ans = None
	for d in range(1, y - x + 1):
		arr = []
		num = x
		while num <= y:
			arr.append(num)
			num += d
		if len(arr) <= n and x in arr and (y in arr):
			diff = d
			break
	for start in range(1, x + 1):
		ans = []
		num = start
		for i in range(n):
			ans.append(num)
			num += diff
		if x in ans and y in ans:
			print(*ans)
			return
t = 1
t = int(input())
for _ in range(t):
	b()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if n >= a - x + (b - y):
		print(x * y)
	else:
		aval = max(a - n, x)
		bval = max(b - n, y)
		if aval < bval:
			n -= a - aval
			a = aval
			if n > 0:
				b -= n
		else:
			n -= b - bval
			b = bval
			if n > 0:
				a -= n
		print(a * b)


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

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

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

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

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def solve():
	for _ in range(ii()):
		(a, b, x, y, n) = mi()
		a1 = a - min(a - x, n)
		b1 = b - min(b - y, n)
		x1 = min(a - x, n)
		x2 = min(b - y, n)
		ans = [a1 * b, b1 * a]
		if x1 < n:
			n1 = n - x1
			b2 = b - min(b - y, n1)
			ans.append(a1 * b2)
		if x2 < n:
			n1 = n - x2
			a2 = a - min(a - x, n1)
			ans.append(a2 * b1)
		print(min(ans))
if file:
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


from sys import *
ws = lambda : map(int, stdin.readline().strip().split())
li = lambda : list(map(int, stdin.readline().strip().split()))
mod = 1000000007

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

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

def prod(l):
	ans = 1
	for i in range(len(l)):
		ans = ans * l[i]
	return ans

def sortindex(l, a):
	c = []
	if a == -1:
		rev = True
	else:
		rev = False
	for i in range(len(l)):
		c.append([l[i], i])
	x = sorted(c, reverse=rev)
	print(x)
	c = []
	for i in range(len(l)):
		c.append(x[i][1])
	return c
for testcases in range(int(input())):
	(a, b, x, y, n) = ws()
	ans = []
	if b > a:
		(b, a) = (a, b)
		(y, x) = (x, y)
	temp1 = a - x
	temp2 = b - y
	if temp2 >= n:
		ans.append(a * (b - n))
	else:
		ans.append((b - temp2) * (a - min(temp1, n - temp2)))
	if temp1 >= n:
		ans.append((a - n) * b)
	else:
		ans.append((a - temp1) * (b - min(temp2, n - temp1)))
	print(min(ans))


def dostuff(a, b, x, y, n):
	if b - y < n:
		n -= b - y
		return max(x, a - n) * y
	else:
		b -= n
		return a * b

def process():
	(a, b, x, y, n) = map(int, input().split())
	return min(dostuff(a, b, x, y, n), dostuff(b, a, y, x, n))
for i in range(int(input())):
	print(process())


from collections import defaultdict as dc
from collections import Counter
import sys
import math
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(c, d, l, r, m) = (a, b, x, y, n)
	p = min(n, a - x)
	a -= p
	n -= p
	q = min(n, b - y)
	b -= q
	n = 0
	t = a * b
	q = min(m, d - r)
	d -= q
	m -= q
	p = min(m, c - l)
	c -= p
	m -= p
	print(min(a * b, c * d))


def solve(a, b, x, y, n):
	k = min(n, a - x)
	a -= k
	n -= k
	b = max(y, b - n)
	return a * b
t = int(input())
ans = []
while t:
	lst = [int(num) for num in input().split()]
	(a, b, x, y, n) = (lst[0], lst[1], lst[2], lst[3], lst[4])
	ans.append(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))
	t -= 1
for a in ans:
	print(a)


def met1(a, b, x, y, n):
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a == b and x > y:
		(x, y) = (y, x)
	a = a - n
	if a < x:
		b -= x - a
		a = x
		if b < y:
			b = y
	return a * b

def met2(a, b, x, y, n):
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a == b and x > y:
		(x, y) = (y, x)
	b = b - n
	if b < y:
		a -= y - b
		b = y
		if a < x:
			a = x
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = met1(a, b, x, y, n)
	a2 = met2(a, b, x, y, n)
	print(min(a1, a2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	if a - x + b - y <= n:
		a = x
		b = y
	elif x <= y and a - x <= n:
		a = x
		n = n - (a1 - x)
		b = b - n
	elif x > y and b - y <= n:
		b = y
		n = n - (b1 - y)
		a = a - n
	elif x <= y and b - y <= n:
		if a - n > y:
			b = y
			a = a - (n - (b1 - y))
		else:
			a = a - n
	elif x > y and a - x <= n:
		if b - n > x:
			a = x
			b = b - (n - (a1 - x))
		else:
			b = b - n
	elif a <= b:
		a = a - n
	else:
		b = b - n
	print(a * b)


import sys
from math import ceil
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

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

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	aa = a
	bb = b
	nn = n
	if aa - x >= nn:
		aa -= nn
	else:
		nn = nn - (aa - x)
		aa = x
		if bb - y >= nn:
			bb -= nn
		else:
			bb = y
	ans = aa * bb
	(aa, bb) = (b, a)
	(x, y) = (y, x)
	if aa - x >= n:
		aa -= n
	else:
		n = n - (aa - x)
		aa = x
		if bb - y >= n:
			bb -= n
		else:
			bb = y
	ans = min(ans, aa * bb)
	print(ans)


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if abs(a - min(a - x, n) - 1) <= abs(b - min(b - y, n) - 1):
		oa = a
		a -= min(a - x, n)
		n -= oa - a
		b -= min(b - y, n)
	else:
		ob = b
		b -= min(b - y, n)
		n -= ob - b
		a -= min(a - x, n)
	print(a * b)


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if max(x, a - n) * max(y, b - max(0, x - a + n)) < max(y, b - n) * max(x, a - max(0, y - b + n)):
		f = a - n
		s = b
		if f < x:
			s = b - (x - f)
			f = x
		if s < y:
			s = y
	else:
		f = b - n
		s = a
		if f < y:
			s = a - (y - f)
			f = y
		if s < x:
			s = x
	print(s * f)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	aco = a
	bco = b
	nco = n
	dif1 = a - x
	dif2 = b - y
	ans = []
	a -= min(dif1, n)
	n -= min(dif1, n)
	b -= min(dif2, n)
	ans.append(a * b)
	n = nco
	a = aco
	b = bco
	b -= min(dif2, n)
	n -= min(dif2, n)
	a -= min(dif1, n)
	ans.append(a * b)
	print(min(ans))


from math import ceil
for _ in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	p1 = max(x, a - n)
	q1 = max(y, b - p1 - n + a)
	p2 = max(y, b - n)
	q2 = max(x, a - p2 - n + b)
	print(min(p1 * q1, p2 * q2))


import sys
input = sys.stdin.buffer.readline

def solution():
	(a, b, x, y, n) = map(int, input().split())
	dif1 = a - x
	dif2 = b - y
	m = min(a, b)
	if a == b:
		if dif1 > dif2:
			if dif1 > n:
				a -= n
			else:
				a -= dif1
				b -= min(dif2, n - dif1)
		elif dif2 > n:
			b -= n
		else:
			b -= dif2
			a -= min(dif1, n - dif2)
	elif a - min(n, dif1) < b - min(dif2, n):
		if dif1 > n:
			a -= n
		else:
			a -= dif1
			b -= min(dif2, n - dif1)
	elif dif2 > n:
		b -= n
	else:
		b -= dif2
		a -= min(dif1, n - dif2)
	print(a * b)
t = int(input())
for _ in range(t):
	solution()


def func(a, b, x, y, n):
	a0 = max(a - n, x)
	n0 = n - (a - a0)
	b0 = max(b - n0, y)
	b1 = max(b - n, y)
	n1 = n - (b - b1)
	a1 = max(a - n1, x)
	return min(a0 * b0, a1 * b1)
t = int(input())
for i in range(t):
	inpt = list(map(int, input().rstrip().split()))
	print(func(*inpt))


number = int(input())
result = []

def good(a, b, x, y, n):
	a1 = a - min(a - x, n)
	b1 = b - min(b - y, n)
	a_compliment = max(a + b - a1 - n, y)
	b_compliment = max(a + b - b1 - n, x)
	return min(a1 * a_compliment, b1 * b_compliment)
for i in range(number):
	line = input()
	(a, b, x, y, n) = line.split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	result.append(good(a, b, x, y, n))
for i in range(number):
	print(result[i])


def solve(a, b, x, y, n):
	sub = min(n, a - x)
	a -= sub
	n -= sub
	b = max(y, b - n)
	return a * b
t = int(input())
res = []
while t:
	arr = input().split(' ')
	A = [int(n) for n in arr]
	(a, b, x, y, n) = (A[0], A[1], A[2], A[3], A[4])
	res.append(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))
	t -= 1
for r in res:
	print(r)


t = int(input())
while t > 0:
	(a, b, x, y, n) = [int(i) for i in input().split()]
	a1 = a
	b1 = b
	n1 = n
	if a - x <= n:
		n = n - (a - x)
		a = x
	else:
		a = a - n
		n = 0
	if n != 0:
		if b - y <= n:
			n -= b - y
			b = y
		else:
			b = b - n
			n = 0
	m1 = a * b
	if b1 - y <= n1:
		n1 = n1 - (b1 - y)
		b1 = y
	else:
		b1 = b1 - n1
		n1 = 0
	if n1 != 0:
		if a1 - x <= n1:
			n1 -= a1 - x
			a1 = x
		else:
			a1 = a1 - n1
			n1 = 0
	m2 = a1 * b1
	print(min(m1, m2))
	t -= 1


t = int(input())
while t:
	t = t - 1
	(a, b, x, y, n) = map(int, input().split())
	(p, q) = (a - x, b - y)
	if n > p + q:
		print(x * y)
		continue
	(l1, r1) = (n - b + y, a - x)
	(l2, r2) = (n - a + x, b - y)
	if l1 < 0:
		l1 = 0
	if l2 < 0:
		l2 = 0
	if r1 > n:
		r1 = n
	if r2 > n:
		r2 = n
	ans1 = (a - r1) * (b - (n - r1))
	ans2 = (a - (n - r2)) * (b - r2)
	print(min(ans1, ans2))


l = []
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	m1 = (b - min(n, b - y)) * (a - min(a - x, n - min(n, b - y)))
	m2 = (a - min(n, a - x)) * (b - min(b - y, n - min(n, a - x)))
	l.append(min(m1, m2))
for i in l:
	print(i)


from collections import deque
import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		num1 = max(x, a - n)
		num2 = max(y, b - n)
		if num1 <= num2:
			small = a
			small_ = x
			big = b
			big_ = y
		else:
			small = b
			small_ = y
			big = a
			big_ = x
		if small - small_ >= n:
			print((small - n) * big)
		else:
			print(small_ * (big - (n - small + small_)))


t = int(input())
for i in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	if a - min(a - x, n) < b - min(b - y, n):
		diff = min(a - x, n)
		a -= diff
		n -= diff
		if n:
			diff = min(b - y, n)
			b -= diff
			n -= diff
	else:
		diff = min(b - y, n)
		b -= diff
		n -= diff
		if n:
			diff = min(a - x, n)
			a -= diff
			n -= diff
	print(a * b)


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

def solve(a, b, x, y, n):
	avale = abs(a - x)
	bvale = abs(b - y)
	avale = min(n, avale)
	a = a - avale
	n = n - avale
	bvale = min(n, bvale)
	b = b - bvale
	return a * b
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = solve(a, b, x, y, n)
	ans2 = solve(b, a, y, x, n)
	print(min(ans1, ans2))


def f():
	t = int(input())
	arr = []
	for _ in range(t):
		arr.append(list(map(int, input().split())))
	for (a, b, x, y, n) in arr:
		(v1, v2) = (0, 0)
		if a - x >= n and b - y >= n:
			(v1, v2) = ((a - n) * b, a * (b - n))
		elif a - x >= n:
			(v1, v2) = ((a - n) * b, (a - (n - (b - y))) * y)
		elif b - y >= n:
			(v1, v2) = (x * (b - (n - (a - x))), a * (b - n))
		elif a - x + b - y <= n:
			(v1, v2) = (x * y, x * y)
		else:
			(v1, v2) = (x * (b - (n - (a - x))), (a - (n - (b - y))) * y)
		print(min(v1, v2))
f()


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	ans = a * b
	for i in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, p) = (a, b, n)
	z = max(x, a1 - n)
	p = p - (a - z)
	a1 = z
	b1 = max(y, b - p)
	ans1 = a1 * b1
	z = max(y, b - n)
	n = n - (b - z)
	b = z
	a = max(x, a - n)
	ans2 = a * b
	print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	val1 = max(a - n, x)
	if val1 == x:
		val2 = max(b - (n - a + x), y)
	else:
		val2 = b
	val3 = max(b - n, y)
	if val3 == y:
		val4 = max(a - (n - b + y), x)
	else:
		val4 = a
	print(min(val1 * val2, val3 * val4))


def min_val(a, b, x, y, n):
	k = min(n, a - x)
	a = a - k
	b = b - min(n - k, b - y)
	return a * b
t = int(input())
while t > 0:
	(a, b, x, y, n) = map(int, input().split())
	print(min(min_val(a, b, x, y, n), min_val(b, a, y, x, n)))
	t -= 1


def minimumProduct(a: int, b: int, x: int, y: int, n: int) -> int:
	new_a1 = max(x, a - n)
	moves_left = n - (a - new_a1)
	new_b2 = max(y, b - moves_left)
	new_b1 = max(y, b - n)
	moves_left = n - (b - new_b1)
	new_a2 = max(x, a - moves_left)
	return min(new_a1 * new_b2, new_b1 * new_a2)
test_cases = int(input())
for _ in range(test_cases):
	inputs = list(map(int, input().split(' ')))
	print(minimumProduct(inputs[0], inputs[1], inputs[2], inputs[3], inputs[4]))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a2, b2) = (a, b)
	if a2 - x >= n:
		prima = (a2 - n) * b2
	else:
		restoPraB = abs(a2 - x - n)
		if b2 - y < restoPraB:
			prima = x * y
		else:
			prima = x * (b2 - restoPraB)
	(a3, b3) = (a, b)
	if b3 - y >= n:
		primb = (b3 - n) * a3
	else:
		restoPraA = abs(b3 - y - n)
		if a3 - x < restoPraA:
			primb = y * x
		else:
			primb = y * (a3 - restoPraA)
	print(min(prima, primb))


t = int(input())

def result(a, b, x, y, n):
	if n >= a - x + b - y:
		return x * y
	return min([(a - i) * (b - n + i) for i in [min(n, a - x), max(0, n + y - b)]])
for test in range(t):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	print(result(a, b, x, y, n))


def mr(a, b, x, y, n):
	r = 10 ** 18
	for i in range(2):
		k = min(n, a - x)
		e = min(n - k, b - y)
		r = min(r, (a - k) * (b - e))
		(a, b) = (b, a)
		(x, y) = (y, x)
	return r
n = int(input())
for i in range(n):
	(a, b, x, y, n) = map(int, input().split())
	print(mr(a, b, x, y, n))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	n1 = n
	a1 = a - n1
	if a1 < x:
		a1 = x
	n1 -= a - a1
	b1 = b - n1
	if b1 < y:
		b1 = y
	n1 -= b - b1
	prod1 = a1 * b1
	n2 = n
	b2 = b - n2
	if b2 < y:
		b2 = y
	n2 -= b - b2
	a2 = a - n2
	if a2 < x:
		a2 = x
	n2 -= a - a2
	prod2 = a2 * b2
	print(min(prod1, prod2))


def solve():
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	n1 = n
	if b > a:
		c = b
		b = a
		a = c
		d = x
		x = y
		y = d
	rem = b - y
	if rem <= n:
		n -= rem
		b = y
	else:
		b -= n
		n = 0
	a -= n
	if b1 <= a1:
		c1 = b1
		b1 = a1
		a1 = c1
		d1 = x1
		x1 = y1
		y1 = d1
	rem1 = b1 - y1
	if rem1 <= n1:
		n1 -= rem1
		b1 = y1
	else:
		b1 -= n1
		n1 = 0
	a1 -= n1
	print(min(max(a1, x1) * max(b1, y1), max(a, x) * max(b, y)))
t = int(input())
for i in range(t):
	solve()


try:
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = map(int, input().split())
		flag = False
		if (b - n <= 1 and y == 1) and flag == False:
			var1 = n - (b - y)
			a = a - min(abs(a - x), var1)
			print(a)
			flag = True
		if (a - n <= 1 and x == 1) and flag == False:
			var1 = n - (a - x)
			b = b - min(abs(b - y), var1)
			print(b)
			flag = True
		elif flag == False:
			a1 = a
			a2 = a
			n1 = n
			n2 = n
			b1 = b
			b2 = b
			hehe1 = abs(a1 - x)
			m1 = min(hehe1, n1)
			a1 -= m1
			n1 -= m1
			hehe2 = abs(b1 - y)
			m2 = min(n1, hehe2)
			b1 -= m2
			ans1 = a1 * b1
			hehe3 = abs(b2 - y)
			m3 = min(hehe3, n2)
			b2 -= m3
			n2 -= m3
			hehe4 = abs(a2 - x)
			m4 = min(n2, hehe4)
			a2 -= m4
			ans2 = a2 * b2
			print(min(ans1, ans2))
except:
	pass


t = int(input())
for __ in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	c = max(a - n, x)
	n1 = n - (a - c)
	d = max(b - n1, y)
	ans1 = c * d
	e = max(b - n, y)
	n1 = n - (b - e)
	f = max(a - n1, x)
	ans2 = e * f
	print(min(ans1, ans2))


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c1 = a - x
	c2 = b - y
	n2 = n
	a2 = a
	b2 = b
	a -= min(c1, n)
	n -= min(c1, n)
	b -= min(c2, n)
	minx = a * b
	b2 -= min(c2, n2)
	n2 -= min(c2, n2)
	a2 -= min(c1, n2)
	minx = min(minx, a2 * b2)
	print(minx)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(i, j, k, l) = (a, b, x, y)
	p = 0
	q = 0
	if y > x:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if n >= b - y:
		n -= b - y
		b = y
		if n >= a - x:
			a = x
		else:
			a -= n
	else:
		b -= n
	p = a * b
	(a, b, x, y) = (i, j, k, l)
	if b > a:
		(a, b) = (b, a)
		(x, y) = (y, x)
	q = 0
	if n >= b - y:
		n -= b - y
		b = y
		if n >= a - x:
			a = x
		else:
			a -= n
	else:
		b -= n
	q = a * b
	print(min(p, q))


t = int(input())
answer = []
for t in range(t):
	(a, b, x, y, n) = list(map(int, input().split(' ')))
	diff1 = a - x
	diff2 = b - y
	temp = float('inf')
	if diff1 <= n:
		if b - n + diff1 >= y:
			temp2 = b - n + diff1
		else:
			temp2 = y
		temp = min(temp, (a - diff1) * temp2)
	if diff2 <= n:
		if a - n + diff2 >= x:
			temp2 = a - n + diff2
		else:
			temp2 = x
		temp = min(temp, temp2 * (b - diff2))
	if diff1 > n:
		temp = min(temp, (a - n) * b)
	if diff2 > n:
		temp = min(temp, (b - n) * a)
	answer.append(str(temp))
print('\n'.join(answer))


def product(a, b, x, y, n):
	if a - x >= n:
		a = a - n
		b = b
		return a * b
	if a - x < n:
		c = x
		r = n - (a - x)
		if b - y >= r:
			b = b - r
			return c * b
		else:
			b = y
			return c * b
for item in [0] * int(input()):
	(a, b, x, y, n) = list(map(int, input().split()))
	print(min(product(a, b, x, y, n), product(b, a, y, x, n)))


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split(' '))
	new_a1 = a - min(n, a - x)
	n1 = n - min(n, a - x)
	new_b1 = b - min(n1, b - y)
	new_b2 = b - min(n, b - y)
	n2 = n - min(n, b - y)
	new_a2 = a - min(n2, a - x)
	if new_a1 * new_b1 < new_b2 * new_a2:
		print(new_a1 * new_b1)
	else:
		print(new_a2 * new_b2)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	l = []
	if b >= a:
		r1 = a - x
		r2 = b - y
		if n >= r1:
			a = a - r1
			n = n - r1
			if n >= r2:
				b = b - r2
				n = n - r2
			else:
				b = b - n
		else:
			a = a - n
			n = 0
		k1 = a * b
		(a, b, x, y, n) = (a1, b1, x1, y1, n1)
		r1 = a - x
		r2 = b - y
		if n >= r2:
			b = b - r2
			n = n - r2
			if n >= r1:
				a = a - r1
				n = n - r1
			else:
				a = a - n
		else:
			b = b - n
			n = 0
		k2 = a * b
		l.append(k1)
		l.append(k2)
	else:
		r1 = a - x
		r2 = b - y
		if n >= r2:
			b = b - r2
			n = n - r2
			if n >= r1:
				a = a - r1
				n = n - r1
			else:
				a = a - n
		else:
			b = b - n
			n = 0
		k3 = a * b
		(a, b, x, y, n) = (a1, b1, x1, y1, n1)
		if n >= r1:
			a = a - r1
			n = n - r1
			if n >= r2:
				b = b - r2
				n = n - r2
			else:
				b = b - n
		else:
			a = a - n
			n = 0
		k4 = a * b
		l.append(k3)
		l.append(k4)
	print(min(l))


import math

def prod(a, b, x, y, n):
	if a - x >= n:
		return (a - n) * b
	else:
		n = n - (a - x)
		a = x
		if b - y >= n:
			return (b - n) * a
		else:
			return y * a

def foc(a, b, x, y, n):
	h1 = prod(a, b, x, y, n)
	h2 = prod(b, a, y, x, n)
	return min(h1, h2)
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	print(foc(a, b, x, y, n))


t = input()
t = int(t)
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if y <= b - n:
		c1 = a * (b - n)
	elif n > b - y and n <= b - y + (a - x):
		c1 = (a - (n - b + y)) * y
	else:
		c1 = x * y
	if x <= a - n:
		c2 = (a - n) * b
	elif n > a - x and n <= b - y + (a - x):
		c2 = x * (b - (n - a + x))
	else:
		c2 = x * y
	print(min(c1, c2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if n >= a - x + b - y:
		print(x * y)
	elif a >= b:
		if b - y >= n:
			print(a * (b - n))
		else:
			m1 = (a - (n - b + y)) * y
			if a - x >= n:
				m2 = (a - n) * b
			else:
				z = x + n - a
				m2 = x * (b - z)
			print(min(m1, m2))
	elif a - x >= n:
		print(b * (a - n))
	else:
		m1 = (b - (n - a + x)) * x
		if b - y >= n:
			m2 = (b - n) * a
		else:
			z = y + n - b
			m2 = y * (a - z)
		print(min(m1, m2))


def solve(a, b, x, y, n):
	temp = min(a - x, n)
	a -= temp
	n -= temp
	b -= min(b - y, n)
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	tempa = a
	tempb = b
	tempn = n
	diffa = a - x
	diffb = b - y
	a = a - min(diffa, n)
	n = n - min(diffa, n)
	b = b - min(diffb, n)
	n = n - min(diffb, n)
	ans1 = a * b
	a = tempa
	b = tempb
	n = tempn
	b = b - min(diffb, n)
	n = n - min(diffb, n)
	a = a - min(diffa, n)
	n = n - min(diffa, n)
	print(min(ans1, a * b))


t = int(input())
for _ in range(t):
	res = float('inf')
	(a, b, x, y, n) = map(int, input().split())
	for _ in range(2):
		a_red = min(n, a - x)
		b_red = min(n - a_red, b - y)
		res = min(res, (a - a_red) * (b - b_red))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(res)


def abc(a, b, x, y, n):
	d = min(a - x, n)
	a -= d
	n -= d
	d = min(b - y, n)
	b -= d
	n -= d
	return a * b

def cba(a, b, x, y, n):
	d = min(b - y, n)
	b -= d
	n -= d
	d = min(a - x, n)
	a -= d
	n -= d
	return a * b
t = int(input())
from math import gcd
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = abc(a, b, x, y, n)
	ans = min(ans, cba(a, b, x, y, n))
	print(ans)


for tt in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 0
	if a + b - x - y < n:
		print(x * y)
		continue
	if a - x >= n:
		ans = b * (a - n)
	else:
		ans = (a - (a - x)) * (b - n + (a - x))
	if b - y >= n:
		ans = min(ans, a * (b - n))
	else:
		ans = min(ans, (b - (b - y)) * (a - n + (b - y)))
	print(ans)


def solve(a, b, x, y, n):
	op = 0
	ma = max(a - n, x)
	mb = max(b - n, y)
	if ma < mb:
		newa = max(a - n, x)
		n = n - (a - newa)
		newb = max(b - n, y)
		return newa * newb
	elif ma == mb:
		if x < y:
			newa = max(a - n, x)
			n = n - (a - newa)
			newb = max(b - n, y)
			return newa * newb
		else:
			newb = max(b - n, y)
			n = n - (b - newb)
			newa = max(a - n, x)
			return newa * newb
	else:
		newb = max(b - n, y)
		n = n - (b - newb)
		newa = max(a - n, x)
		return newa * newb
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(solve(a, b, x, y, n))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	diff1 = a - x
	diff2 = b - y
	ans = []
	a1 = a
	b1 = b
	on = n
	if diff1 + diff2 <= n:
		print(x * y)
	else:
		a -= min(diff1, n)
		if n > diff1:
			n -= diff1
			b -= min(n, diff2)
		ans.append(a * b)
		a = a1
		b = b1
		n = on
		b -= min(n, diff2)
		if n > diff2:
			n -= diff2
			a -= min(diff1, n)
		ans.append(a * b)
		print(min(ans))


import bisect
import copy
import fractions
import functools
import heapq
import math
import random
import sys

def f(gr, gr_lim, ls, ls_lim, N):
	ls_diff = ls - ls_lim
	if ls_diff > N:
		ls -= N
	else:
		ls = ls_lim
		N -= ls_diff
		gr_diff = gr - gr_lim
		if gr_diff > N:
			gr -= N
		else:
			gr = gr_lim
			N -= gr_diff
	return ls * gr
T = int(input())
for t in range(T):
	(A, B, X, Y, N) = tuple(map(int, input().split()))
	print(str(min(f(A, X, B, Y, N), f(B, Y, A, X, N))))


def fun(a, b, x, y, n):
	if a - x >= n:
		a = a - n
		p1 = a * b
		return p1
	elif a - x < n:
		n = n - (a - x)
		a = x
		if b - y >= n:
			b = b - n
			p2 = a * b
			return p2
		else:
			b = y
			p3 = a * b
			return p3
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = fun(a, b, x, y, n)
	ans2 = fun(b, a, y, x, n)
	print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c = max(b - n, y)
	p = min(max(a - n, x), c)
	print(p * max(a - n + b - p, x if p == c else y))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	amin = max(x, a - n)
	bmax = max(y, b - (n - (a - amin)))
	bmin = max(y, b - n)
	amax = max(x, a - (n - (b - bmin)))
	ans = min(amin * bmax, bmin * amax)
	print(ans)


import sys
input = lambda : sys.stdin.readline()
int_arr = lambda : list(map(int, input().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().split())
get_int = lambda : map(int, input().split())
get_flo = lambda : map(float, input().split())
mod = 1000000007

def solve(a, b, x, y, n):
	p = min(n, a - x)
	q = min(n - p, b - y)
	p1 = min(n, b - y)
	q1 = min(n - p1, a - x)
	print(min((a - p) * (b - q), (b - p1) * (a - q1)))
for _ in range(int(input())):
	(a, b, x, y, n) = get_int()
	solve(a, b, x, y, n)


t = int(input())
for _ in range(t):
	[a, b, x, y, n] = [int(x) for x in input().split()]
	asub = max(x, a - n)
	bsub = max(y, b - n)
	if asub < bsub:
		n -= a - asub
		a = asub
		b = max(y, b - n)
		print(a * b)
	else:
		n -= b - bsub
		b = bsub
		a = max(x, a - n)
		print(a * b)


n = int(input())
result = []
for i in range(n):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	temp1 = a
	temp2 = b
	temp3 = n
	if temp1 - temp3 < x:
		temp3 -= temp1 - x
		temp1 = x
	else:
		temp1 -= temp3
		temp3 = 0
	if b - n < y:
		n -= b - y
		b = y
	else:
		b -= n
		n = 0
	if temp2 - temp3 < y:
		temp2 = y
	else:
		temp2 -= temp3
	if a - n < x:
		a = x
	else:
		a -= n
	r1 = a * b
	r2 = temp1 * temp2
	result.append(r1 if r1 < r2 else r2)
for i in result:
	print(i)


t = int(input())
arr = []
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	arr.append((a, b, x, y, n))
for x in arr:
	(a, b, x, y, n) = (x[0], x[1], x[2], x[3], x[4])
	ans1 = 0
	ans2 = 0
	if b - y >= n:
		ans1 = a * (b - n)
	else:
		ans1 = y * max(a - (n - (b - y)), x)
	if a - x >= n:
		ans2 = b * (a - n)
	else:
		ans2 = x * max(b - (n - (a - x)), y)
	print(min(ans1, ans2))


import io, os
inp = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
inar = lambda : list(map(int, inp().split()))
inin = lambda : int(inp())
inst = lambda : inp().decode().strip()

def all_factors(n):
	(small, large) = ([], [])
	for i in range(1, int(n ** 0.5) + 1, 2 if n & 1 else 1):
		if not n % i:
			small.append(i)
			large.append(n // i)
	if small[-1] == large[-1]:
		large.pop()
	large.reverse()
	small.extend(large)
	return small
_T_ = inin()
for _t_ in range(_T_):
	(a, b, x, y, n) = inar()
	if a - x + b - y <= n:
		print(x * y)
		continue
	t1 = min(a - x, n)
	a1 = a - t1
	b1 = max(b - (n - t1), y)
	t2 = min(b - y, n)
	b2 = b - t2
	a2 = max(x, a - (n - t2))
	print(min(a1 * b1, a2 * b2))


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop, heapify
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
from itertools import accumulate
from functools import lru_cache
M = mod = 998244353

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

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

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

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

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

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

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

def giveanswer(a, b, x, y, n):
	temp = min(a - x, n)
	a -= temp
	n -= temp
	temp = min(b - y, n)
	b -= temp
	n -= temp
	return a * b
for _ in range(val()):
	(a, b, x, y, n) = li()
	print(min(giveanswer(a, b, x, y, n), giveanswer(b, a, y, x, n)))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	if a == b:
		if x > y:
			(a, b, x, y) = (b, a, y, x)
		if a - x < n:
			n -= a - x
			a = x
			if b - y <= n:
				b = y
			else:
				b = b - n
		else:
			a = a - n
			n = 0
		print(a * b)
		continue
	if max(a - n, x) >= max(b - n, y):
		(a, b, x, y) = (b, a, y, x)
	if a - x < n:
		n -= a - x
		a = x
		if b - y <= n:
			b = y
		else:
			b = b - n
	else:
		a = a - n
		n = 0
	print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	k = min(n, a - x)
	a -= k
	n -= k
	k = min(n, b - y)
	b -= k
	n -= k
	k = min(n1, b1 - y1)
	b1 -= k
	n1 -= k
	k = min(n1, a1 - x1)
	a1 -= k
	n1 -= k
	print(min(a1 * b1, a * b))


def solve(a, b, x, y, n):
	min1 = calc_min_moves(a, b, x, y, n)
	min2 = calc_min_moves(b, a, y, x, n)
	return min(min1, min2)

def calc_min_moves(a, b, x, y, n):
	moves_a = min(n, a - x)
	moves_b = min(n - moves_a, b - y)
	reduced_a = a - moves_a
	reduced_b = b - moves_b
	return reduced_a * reduced_b
t = int(input())
results = list()
for _ in range(0, t):
	(a, b, x, y, n) = map(int, input().split(' '))
	results.append(solve(a, b, x, y, n))
for result in results:
	print(result)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [*map(int, input().split())][:5]
	if a - x + b - y <= n:
		print(x * y)
	else:
		lower = max(0, n + y - b)
		upper = min(n, a - x)
		vals = [lower, upper, (n - b + a) // 2, (n - b + a) // 2 + 1, (n - b + a) // 2 - 1]
		ans = a * b
		for val in vals:
			if lower <= val <= upper:
				ans = min(ans, (a - val) * (b - n + val))
		print(ans)


import math
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	diff_a = a - x
	diff_b = b - y
	n1 = n
	a1 = min(diff_a, n1)
	n1 -= a1
	b1 = min(diff_b, n1)
	ans = (a - a1) * (b - b1)
	n1 = n
	b2 = min(diff_b, n1)
	n1 -= b2
	a2 = min(diff_a, n1)
	temp = (a - a2) * (b - b2)
	ans = min(ans, temp)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	ans = 0
	ax = a - x
	by = b - y
	for i in range(1):
		if n >= ax:
			a = x
			n -= ax
			if n >= by:
				b = y
			else:
				b -= n
		else:
			a -= n
		ans = a * b
	for i in range(1):
		if n1 >= by:
			b1 = y1
			n1 -= by
			if n1 >= ax:
				a1 = x1
			else:
				a1 -= n1
		else:
			b1 -= n1
		ans1 = a1 * b1
	print(min(ans, ans1))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	max_a_decrease = min(a - x, n)
	max_b_decrease = min(b - y, n)
	min_a1 = a - max_a_decrease
	remaining_decrease = n - max_a_decrease
	min_b1 = b - min(max_b_decrease, remaining_decrease)
	min_b2 = b - max_b_decrease
	remaining_decrease = n - max_b_decrease
	min_a2 = a - min(max_a_decrease, remaining_decrease)
	product1 = min_a1 * min_b1
	product2 = min_a2 * min_b2
	min_product = min(product1, product2)
	print(min_product)


t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	t1 = max(a - n, x)
	t2 = max(b - n, y)
	if t1 < t2:
		temp = min(a - x, n)
		a -= temp
		x -= temp
		n -= temp
		b -= min(n, b - y)
	else:
		temp = min(b - y, n)
		b -= temp
		y -= temp
		n -= temp
		a -= min(n, a - x)
	print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	elif a == b and x > y:
		(x, y) = (y, x)
	froma = min(n, a - x)
	nn = n - froma
	aa = a - froma
	bb = max(y, b - nn)
	fromb = min(n, b - y)
	n -= fromb
	b -= fromb
	a = max(x, a - n)
	print(min(a * b, aa * bb))


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a - x + b - y <= n:
		print(x * y)
	else:
		d1 = min(a - x, n)
		d2 = min(b - y, n)
		print(min((a - d1) * (b - (n - d1)), (b - d2) * (a - (n - d2))))


input = __import__('sys').stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	n = min(a - x + b - y, n)
	a1 = a - x
	b1 = b - y
	tmp = 0
	if a1 > n:
		tmp = (a - n) * b
	else:
		tmp = (a - a1) * (b - (n - a1))
	tmp1 = 0
	if b1 > n:
		tmp1 = (b - n) * a
	else:
		tmp1 = (b - b1) * (a - (n - b1))
	print(min(tmp, tmp1))


import sys

def solve(a, b, x, y, n):
	key1 = min(n, b - y)
	b -= key1
	n -= key1
	key2 = min(n, a - x)
	a -= key2
	n -= key2
	return a * b
T = int(sys.stdin.readline())
for _ in range(T):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))


def solution(a, b, x, y, n):
	if a - x + b - y <= n:
		return x * y
	elif max(a - n, x) > max(b - n, y):
		if b - n > y:
			return (b - n) * a
		else:
			return y * (a - (n - (b - y)))
	elif a - n > x:
		return (a - n) * b
	else:
		return x * (b - (n - (a - x)))
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	print(solution(a, b, x, y, n))


def solve():
	T = int(input())
	ans = [float('inf')] * T
	for t in range(T):
		(a, b, x, y, n) = map(int, input().split())
		d = a + b - n
		if d <= x + y:
			ans[t] = x * y
		else:
			if d - a >= y:
				ans[t] = min(ans[t], a * (d - a))
			if d - x <= b:
				ans[t] = min(ans[t], x * (d - x))
			if d - b >= x:
				ans[t] = min(ans[t], b * (d - b))
			if d - y <= a:
				ans[t] = min(ans[t], y * (d - y))
	return ans
print(*solve(), sep='\n')


def main():
	outputs = []
	for __ in range(int(input())):
		(a, b, x, y, n) = list(map(int, input().split()))
		L1 = a - min(n, a - x)
		L2 = b - min(n, b - y)
		minm_product = min(L1 * b, L2 * a)
		diff = max(min(n, a - x), min(n, b - y))
		if L1 > L2:
			print(L2 * (a - min(n - min(n, b - y), min(n, a - x))))
		else:
			print(L1 * (b - min(n - min(n, a - x), min(n, b - y))))
	for output in outputs:
		print(output)
main()


n = int(input())
for i in range(n):
	(a, b, x, y, m) = [int(i) for i in input().split(' ')]
	if a + b - x - y < m:
		print(x * y)
	else:
		ex = max(m - a + x, 0)
		ey = max(m - b + y, 0)
		ax = max(x, a - m)
		ay = max(y, b - m)
		print(min(ax * (b - ex), ay * (a - ey)))


def solve(a, b, x, y, n):
	if a - x + (b - y) <= n:
		return x * y
	else:

		def f(t):
			return (a - t) * (b - (n - t))
		return min(f(max(0, n - (b - y))), f(min(n, a - x)))
for _ in range(int(input())):
	print(solve(*map(int, input().split())))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c = a
	d = b
	m = n
	z = min(a - x, n)
	a = a - z
	n = n - z
	p = min(b - y, n)
	b = b - p
	n = n - p
	p1 = a * b
	r = min(d - y, m)
	d = d - r
	m = m - r
	k = min(c - x, m)
	c = c - k
	m = m - k
	p2 = c * d
	print(min(p1, p2))


from sys import stdin, stdout

def INPUT():
	return list((int(i) for i in stdin.readline().split()))

def inp():
	return stdin.readline()

def out(x):
	return stdout.write(x)
import math
import random
J = 10 ** 19

def c(a, b, x, y, n):
	if a - x + b - y <= n:
		return x * y
	(ans1, ans2, ans3, ans4, ans5, ans6) = (J, J, J, J, J, J)
	d1 = a - x
	d2 = b - y
	if n <= d1:
		ans1 = (a - n) * b
		if d2 <= n:
			ans2 = y * (a - (n - d2))
		else:
			ans2 = a * (b - n)
	elif n <= d2:
		ans3 = (b - n) * a
		if d1 <= n:
			ans4 = x * (b - (n - d1))
		else:
			ans4 = a * (b - n)
	else:
		ans5 = x * (b - (n - d1))
		ans6 = y * (a - (n - d2))
	return min(ans1, ans2, ans3, ans4, ans5, ans6)
for _ in range(int(input())):
	(a, b, x, y, n) = INPUT()
	print(c(a, b, x, y, n))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1) = (a, b)
	if a1 - n >= x:
		a1 -= n
		n1 = 0
	else:
		n1 = n - (a - x)
		a1 = x
	if b1 - n >= y:
		b1 -= n
		n2 = 0
	else:
		n2 = n - (b - y)
		b1 = y
	if a1 < b1:
		a = a1
		if b - n1 >= y:
			b -= n1
		else:
			b = y
	else:
		b = b1
		if a - n2 >= x:
			a -= n2
		else:
			a = x
	print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(a1, b1, n1) = (a, b, n)
	(a2, b2, n2) = (a, b, n)
	if a1 - x <= n1:
		temp = a1
		a1 = x
		n1 -= temp - x
	else:
		a1 -= n1
		n1 = 0
	if n1 >= 0:
		b1 = b1 - n1 if b1 - n1 >= y else y
	ans1 = a1 * b1
	if b2 - y <= n2:
		temp = b2
		b2 = y
		n2 -= temp - y
	else:
		b2 -= n2
		n2 = 0
	if n2 >= 0:
		a2 = a2 - n2 if a2 - n2 >= x else x
	ans2 = a2 * b2
	print(min(ans1, ans2))


import math

def check():
	(a, b, x, y, n) = map(int, input().split())
	c = a
	d = b
	p = x
	q = y
	k = n
	if x <= y:
		if a - x >= n:
			a -= n
			n = 0
		else:
			n -= a - x
			a = x
		if b - y >= n:
			b -= n
			n = 0
		else:
			n -= b - y
			b = y
	else:
		if b - y >= n:
			b -= n
			n = 0
		else:
			n -= b - y
			b = y
		if a - x >= n:
			a -= n
			n = 0
		else:
			n -= a - x
			a = x
	if c <= d:
		if c - p >= k:
			c -= k
			k = 0
		else:
			k -= c - p
			c = p
		if d - q >= k:
			d -= k
			k = 0
		else:
			k -= d - q
			d = q
	else:
		if d - q >= k:
			d -= k
			k = 0
		else:
			k -= d - q
			d = q
		if c - p >= k:
			c -= k
			k = 0
		else:
			k -= c - p
			c = p
	u = min(a * b, c * d)
	return u
for _ in range(int(input())):
	z = check()
	print(z)


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
import heapq
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	var1 = a
	var2 = b
	var = min(a - x, n)
	a -= var
	b -= min(b - y, n - var)
	ans1 = a * b
	varr = min(var2 - y, n)
	var2 -= varr
	var1 -= min(var1 - x, n - varr)
	ans2 = var1 * var2
	print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	p = a
	q = b
	r = x
	s = y
	t = n
	can = b - y
	if can >= n:
		b = b - n
		ans1 = b * a
	else:
		b = y
		n = n - can
		can = a - x
		if can >= n:
			a = a - n
			ans1 = a * b
		else:
			a = x
			ans1 = a * b
	a = q
	b = p
	x = s
	y = r
	n = t
	can = b - y
	if can >= n:
		b -= n
		ans2 = b * a
	else:
		b = y
		n -= can
		can = a - x
		if can >= n:
			a = a - n
			ans2 = a * b
		else:
			a = x
			ans2 = a * b
	print(min(ans2, ans1))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	i = a - x
	j = b - y
	if i <= n and j <= n:
		if i + j <= n:
			print(x * y)
		else:
			a1 = (a - i) * max(y, b - (n - i))
			a2 = max(a - (n - j), x) * (b - j)
			print(min(a1, a2))
	else:
		if i >= n and j >= n:
			a1 = (a - n) * b
			a2 = a * (b - n)
		elif i >= n:
			a1 = (a - n) * b
			a2 = (a - (n - j)) * (b - j)
		elif j >= n:
			a1 = (a - i) * (b - (n - i))
			a2 = a * (b - n)
		print(min(a1, a2))


import sys
import math
import collections
import bisect
import itertools
import decimal
import copy
INF = 10 ** 20
ni = lambda : int(sys.stdin.readline().rstrip())
ns = lambda : map(int, sys.stdin.readline().rstrip().split())
na = lambda : list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda : list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))

def main():
	t = ni()
	for _ in range(t):
		(a, b, x, y, n) = ns()
		t1 = max(a - n, x)
		t2 = max(b - n, y)
		if t1 <= t2:
			r1 = max(a - n, x)
			r2 = max(y, b - (n - min(n, a - x)))
		else:
			r1 = max(b - n, y)
			r2 = max(x, a - (n - min(n, b - y)))
		print(r1 * r2)
main()


def answer(a, b, x, y, n):
	amin = True
	if a > b:
		amin = False
	xbinding = False
	if n - a < x:
		xbinding = True
	ybinding = False
	if n - b < y:
		ybinding = True
	if amin and (not xbinding):
		a -= n
		return a * b
	if not amin and (not ybinding):
		b -= n
		return a * b
	return

def answer2(a, b, x, y, n):
	a_sma = max(x, a - n)
	b_sma = max(y, b - n)
	if a_sma <= b_sma:
		b -= n - (a - a_sma)
		return a_sma * max(b, b_sma)
	else:
		a -= n - (b - b_sma)
		return b_sma * max(a, a_sma)

def main():
	t = int(input())
	a = [0] * t
	b = [0] * t
	x = [0] * t
	y = [0] * t
	n = [0] * t
	for j in range(t):
		(a[j], b[j], x[j], y[j], n[j]) = [int(i) for i in input().split()]
	for j in range(t):
		print(answer2(a[j], b[j], x[j], y[j], n[j]))
main()


for _ in range(int(input())):
	(A, B, X, Y, N) = map(int, input().split())
	(a, b, x, y, n) = (A, B, X, Y, N)
	ans = 0
	if a < b:
		a -= n
		if a < x:
			b -= x - a
			a = x
			if b < y:
				b = y
		ans = a * b
	else:
		b -= n
		if b < y:
			a -= y - b
			b = y
			if a < x:
				a = x
		ans = a * b
	(a, b, x, y, n) = (A, B, X, Y, N)
	if a - x > b - y:
		a -= n
		if a < x:
			b -= x - a
			a = x
			if b < y:
				b = y
		ans1 = a * b
	else:
		b -= n
		if b < y:
			a -= y - b
			b = y
			if a < x:
				a = x
		ans1 = a * b
	print(min(ans, ans1))


t = int(input())

def solve(a, b, x, y, n):
	left = max(a - n, x)
	right = max(b - n, y)
	if left < right:
		return left * max(b - (left - a + n), y)
	else:
		return right * max(a - (right - b + n), x)
for _ in range(t):
	args = [int(x) for x in input().split(' ')]
	print(solve(*args))


def dc(m, min, num):
	if num == 0:
		return (m, num)
	min = max(m - num, min)
	num = num - (m - min)
	return (min, num)
c = int(input())
for i in range(c):
	(a, b, x, y, n) = map(int, input().split())
	aa = max(a - n, x)
	bb = max(b - n, y)
	if aa <= bb:
		(a, n) = dc(a, x, n)
		(b, n) = dc(b, y, n)
	else:
		(b, n) = dc(b, y, n)
		(a, n) = dc(a, x, n)
	print(a * b)


T = int(input())
for t in range(T):
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	x = int(s[2])
	y = int(s[3])
	n = int(s[4])
	A = []
	B = []
	(ta, tb, tn) = (a, b, n)
	d = min(ta - x, n)
	tn -= d
	ta -= d
	d = min(tb - y, tn)
	tb -= d
	A.append(ta)
	B.append(tb)
	(ta, tb, tn) = (a, b, n)
	d = min(tb - y, tn)
	tn -= d
	tb -= d
	d = min(ta - x, tn)
	ta -= d
	A.append(ta)
	B.append(tb)
	print(min(A[0] * B[0], A[1] * B[1]))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())

	def cekb(a, b, x, y, n):
		n2 = n - (b - y)
		if n2 >= 0:
			b = b + (n2 - n)
			a = max(x, a - n2)
			return a * b
		else:
			b -= n
			return a * b

	def ceka(a, b, x, y, n):
		n2 = n - (a - x)
		if n2 >= 0:
			a = a + (n2 - n)
			b = max(y, b - n2)
			return a * b
		else:
			a -= n
			return a * b
	print(min(ceka(a, b, x, y, n), cekb(a, b, x, y, n)))


import math

def solve():
	(x, y, a, b, n) = [int(x) for x in input().split()]
	(res, dx, dy) = (math.inf, x - a, y - b)
	if dx <= n:
		res = min(res, a * max(y - (n - dx), b))
	if dy <= n:
		res = min(res, b * max(x - (n - dy), a))
	if dx > n:
		res = min(res, (x - n) * y)
	if dy > n:
		res = min(res, (y - n) * x)
	return res
t = int(input())
for i in range(t):
	print(solve())


for _ in range(int(input())):
	X = list(map(int, input().split()))
	Y = X[:]
	Temp = X[-1]
	Total = 0
	N = []
	Total = min(X[-1], X[0] - X[2])
	X[0] -= Total
	X[-1] -= Total
	X[1] -= min(X[-1], X[1] - X[3])
	N.append(X[0] * X[1])
	Total = min(Y[-1], Y[1] - Y[3])
	Y[1] -= Total
	Y[-1] -= Total
	Y[0] -= min(Y[-1], Y[0] - Y[2])
	print(min(N[0], Y[0] * Y[1]))


import sys
t = int(sys.stdin.readline())
for num in range(t):
	(a, b, x, y, n) = map(int, sys.stdin.readline().strip().split())
	(a2, b2, x2, y2, n2) = (a, b, x, y, n)
	if a - n <= x:
		n = n - (a - x)
		a = x
		if b - n <= y:
			b = y
		else:
			b = b - n
	else:
		a = a - n
	t1 = a * b
	if b2 - n2 <= y2:
		n2 = n2 - (b2 - y2)
		b2 = y2
		if a2 - n2 <= x2:
			a2 = x2
		else:
			a2 = a2 - n2
	else:
		b2 = b2 - n2
	t2 = a2 * b2
	print(min(t1, t2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	v1 = a - x
	v2 = b - y
	if v1 + v2 <= n:
		print(x * y)
	elif 1:
		oa = a
		ob = b
		on = n
		a = a - min(v1, n)
		n = n - min(v1, n)
		b = b - min(v2, n)
		val = a * b
		a = oa
		b = ob
		n = on
		v1 = a - x
		v2 = b - y
		b = b - min(v2, n)
		n = n - min(v2, n)
		a = a - min(v1, n)
		print(min(val, a * b))


t = int(input())

def func(a, b, x, y, n):
	tmp = max(a - n, x)
	n -= a - tmp
	a = tmp
	tmp = max(b - n, y)
	n -= b - tmp
	b = tmp
	return a * b
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(tmp_1, tmp_2) = (func(a, b, x, y, n), func(b, a, y, x, n))
	print(min(tmp_1, tmp_2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		currA = max(a - n, x)
		currB = max(b - (n - (a - currA)), y)
		ans = currB * currA
		currB = max(b - n, y)
		currA = max(a - (n - (b - currB)), x)
		ans = min(ans, currA * currB)
		print(ans)


def cal(a, b, x, y, n):
	d = a - x
	d = min(d, n)
	n -= d
	a -= d
	d = b - y
	d = min(d, n)
	b -= d
	return a * b
for _ in range(0, int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(cal(a, b, x, y, n), cal(b, a, y, x, n)))


import sys, math
mod = 10 ** 9 + 7

def goSolve(a, b, x, y, n):
	d = min(n, a - x)
	a -= d
	n -= d
	d = min(n, b - y)
	b -= d
	return a * b

def solve(test_index):
	(a, b, x, y, n) = list(map(int, input().split()))
	print(min(goSolve(a, b, x, y, n), goSolve(b, a, y, x, n)))
	return
if 'PyPy' not in sys.version:
	sys.stdin = open('input.txt', 'r')
sys.setrecursionlimit(100000)
num_tests = 1
num_tests = int(input())
for test in range(1, num_tests + 1):
	solve(test)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(n_first, n_second) = (n, n)
	if a - x > n_first:
		first_a = a - n_first
		n_first = 0
	else:
		first_a = x
		n_first = n_first - (a - x)
	if b - y > n_first:
		first_b = b - n_first
	else:
		first_b = y
	if b - y > n_second:
		second_b = b - n_second
		n_second = 0
	else:
		second_b = y
		n_second = n_second - (b - y)
	if a - x > n_second:
		second_a = a - n_second
	else:
		second_a = x
	print(min(first_a * first_b, second_a * second_b))


import math
for _ in range(int(input())):
	d = list(map(int, input().split()))
	a = d[0]
	b = d[1]
	x = d[2]
	y = d[3]
	n = d[4]
	l = a - x
	m = b - y
	h = min(l, n)
	a -= h
	l -= h
	n -= h
	g = min(m, n)
	b -= g
	m -= g
	n -= g
	p1 = a * b
	a = d[0]
	b = d[1]
	x = d[2]
	y = d[3]
	n = d[4]
	l = a - x
	m = b - y
	g = min(m, n)
	b -= g
	m -= g
	n -= g
	h = min(l, n)
	a -= h
	l -= h
	n -= h
	p2 = a * b
	print(min(p1, p2))


t = int(input())
result = []
for _ in range(0, t):
	line = input()
	line = line.split()
	ax = int(line[0]) - int(line[2])
	by = int(line[1]) - int(line[3])
	a = int(line[0])
	b = int(line[1])
	rest = int(line[4])
	if int(line[0]) + int(line[1]) - (int(line[2]) + int(line[3])) <= int(line[4]):
		result.append(int(line[2]) * int(line[3]))
	else:
		rest1 = by - rest
		rest2 = ax - rest
		if rest1 < 0:
			b1 = int(line[3])
			a1 = a + rest1
			resu1 = a1 * b1
		if rest1 >= 0:
			b1 = b - rest
			a1 = a
			resu1 = a1 * b1
		if rest2 < 0:
			a2 = int(line[2])
			b2 = b + rest2
			resu2 = a2 * b2
		if rest2 >= 0:
			a2 = a - rest
			b2 = b
			resu2 = a2 * b2
		if resu1 < resu2:
			result.append(resu1)
		else:
			result.append(resu2)
for i in result:
	print(i)


import sys
import math
tests = int(input())
for i in range(tests):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	to_reduce = ''
	n1 = n
	a1 = a
	b1 = b
	red = min(n1, a1 - x)
	a1 -= red
	n1 -= red
	red = min(n1, b1 - y)
	b1 -= red
	red = min(n, b - y)
	b -= red
	n -= red
	red = min(n, a - x)
	a -= red
	print(min(a * b, a1 * b1))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a - x >= n:
		if b - y >= n:
			if a > b:
				print((b - n) * a)
			else:
				print((a - n) * b)
		else:
			r = min(n - (b - y), a - x)
			if y * (a - r) < (a - n) * b:
				print(y * (a - r))
			else:
				print((a - n) * b)
	elif b - y >= n:
		r = min(n - (a - x), b - y)
		if (b - r) * x < (b - n) * a:
			print((b - r) * x)
		else:
			print((b - n) * a)
	else:
		r = min(n - (a - x), b - y)
		w = min(n - (b - y), a - x)
		if x * (b - r) < y * (a - w):
			print(x * (b - r))
		else:
			print(y * (a - w))


import os
from sys import stdin, stdout

def solve(tc):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	ra = a - x
	rb = b - y
	if n >= ra + rb:
		print(x * y)
		return
	nn = n
	aa = a
	bb = b
	ans = int(1e+18)
	if ra < nn:
		aa -= ra
		nn -= ra
	else:
		aa -= nn
		nn = 0
	bb -= nn
	ans = min(ans, aa * bb)
	nn = n
	aa = a
	bb = b
	if rb < nn:
		bb -= rb
		nn -= rb
	else:
		bb -= nn
		nn = 0
	aa -= nn
	ans = min(ans, aa * bb)
	print(ans)
tcs = 1
tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


import sys
mod = 10 ** 9 + 7
INF = float('inf')

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

def inpl():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(inp()):
	(a, b, x, y, n) = inpl()
	s = a - min(a - x, n)
	t = b - min(b - y, n)
	if t < s:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a - x < n:
		n -= a - x
		a = x
	else:
		a -= n
		n = 0
	if b - y < n:
		b = y
	else:
		b -= n
	print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = a * b
	temp_a = a - x
	temp_b = b - y
	if n >= temp_a:
		rem_n = n - temp_a
		if rem_n >= temp_b:
			ans = min(x * y, ans)
		else:
			ans = min(x * (b - rem_n), ans)
	else:
		ans = min(ans, (a - n) * b)
	if n >= temp_b:
		rem_n = n - temp_b
		if rem_n >= temp_a:
			ans = min(x * y, ans)
		else:
			ans = min(ans, (a - rem_n) * y)
	else:
		ans = min(ans, (b - n) * a)
	print(ans)


from collections import *
import sys

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

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	(a, b, x, y, n) = rl()
	ans = 10 ** 18
	d1 = a - x
	d2 = b - y
	if d1 >= n:
		ans = min((a - n) * b, ans)
	if d2 >= n:
		ans = min((b - n) * a, ans)
	if d1 < n:
		rest = n - d1
		if b - rest >= y:
			ans = min(ans, x * (b - rest))
		else:
			ans = min(ans, x * y)
	if d2 < n:
		rest = n - d2
		if a - rest >= x:
			ans = min(ans, y * (a - rest))
		else:
			ans = min(ans, x * y)
	print(ans)


import sys

def rs():
	return sys.stdin.readline().rstrip()

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

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

def ws(s):
	sys.stdout.write(s + '\n')

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

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import defaultdict
for _ in range(ri()):
	(a, b, x, y, n) = ria()
	p = a - x
	q = b - y
	(p1, q1) = (p, q)
	n1 = n
	(a1, b1) = (a, b)
	m = min(n, p)
	n -= m
	a -= m
	m = min(n, q)
	n -= m
	b -= m
	d = a * b
	m = min(q, n1)
	b1 -= m
	n1 -= m
	m = min(p, n1)
	n1 -= m
	a1 -= m
	wi(min(a * b, a1 * b1))


def solve(a1, b1, n1, x, y):
	acpy = a1
	a1 = max(x, a1 - n1)
	n1 = max(0, n1 - (acpy - x))
	b1 = max(y, b1 - n1)
	return a1 * b1
T = int(input())
for i in range(T):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	print(min(solve(a, b, n, x, y), solve(b, a, n, y, x)))


from math import *
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = max(a - n, x)
	n1 = max(n - (a - x), 0)
	b1 = max(b - n1, y)
	b2 = max(b - n, y)
	n2 = max(n - (b - y), 0)
	a2 = max(a - n2, x)
	print(min(a1 * b1, a2 * b2))


from collections import Counter
from collections import OrderedDict
from collections import defaultdict

def SOCountR(mylist):
	return OrderedDict(sorted(Counter(mylist).items(), reverse=True))

def SOCount(mylist):
	return OrderedDict(sorted(Counter(mylist).items()))

def freq_count(mylist):
	return Counter(mylist)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		mini = b
		chota = y
		maxa = a
		bada = x
	else:
		mini = a
		chota = x
		maxa = b
		bada = y
	mini1 = mini
	maxa1 = maxa
	chota1 = chota
	bada1 = bada
	n1 = n
	diff = mini - chota
	if diff <= n:
		n -= diff
		mini = chota
	else:
		mini -= n
		n = 0
	diff = maxa - bada
	if diff <= n:
		n -= diff
		maxa = bada
	else:
		maxa -= n
		n = 0
	diff = maxa1 - bada1
	if diff <= n1:
		n1 -= diff
		maxa1 = bada1
	else:
		maxa1 -= n1
		n1 = 0
	diff = mini1 - chota1
	if diff <= n1:
		n1 -= diff
		mini1 = chota1
	else:
		mini1 -= n1
		n1 = 0
	print(min(maxa * mini, maxa1 * mini1))


for case in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	(a2, b2, x2, y2, n2) = [b, a, y, x, n]
	d = min(b - y, n)
	b -= d
	n -= d
	if n > 0:
		d = min(a - x, n)
		a -= d
		n -= d
	ans1 = a * b
	(a, b, x, y, n) = [a2, b2, x2, y2, n2]
	d = min(b - y, n)
	b -= d
	n -= d
	if n > 0:
		d = min(a - x, n)
		a -= d
		n -= d
	ans2 = a * b
	print(min(ans1, ans2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if max(x, a - n) < max(y, b - n):
		(a, b) = (b, a)
		(x, y) = (y, x)
	x1 = min(n, abs(b - y))
	b -= x1
	n -= x1
	x1 = min(n, abs(a - x))
	a -= x1
	n -= x1
	print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(str, input().split())
	a = int(a.replace(',', ''))
	b = int(b.replace(',', ''))
	x = int(x.replace(',', ''))
	y = int(y.replace(',', ''))
	n = int(n.replace(',', ''))
	i = min(a - x, n)
	j = min(b - y, n)
	if a - i < b - j:
		if a - x >= n:
			n = 0
		else:
			n -= i
		print((a - i) * (b - min(b - y, n)))
	else:
		if b - y >= n:
			n = 0
		else:
			n -= j
		print((b - j) * (a - min(a - x, n)))


T = int(input())
for t in range(T):
	(a, b, x, y, n) = map(int, input().split())
	ans = float('inf')
	for _ in range(2):
		c = min(n, a - x)
		d = min(n - c, b - y)
		ans = min(ans, (a - c) * (b - d))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	za = a
	zb = b
	if n > 0:
		k = a - x
		l = n - k
		m = b - y
		if l >= 0 or k == 0:
			a = a - k
			if m < l:
				b = b - m
			else:
				b = b - l
		elif l < 0:
			a = a - n
		pa = a * b
	a = za
	b = zb
	if n > 0:
		k = b - y
		l = n - k
		m = a - x
		if l >= 0 or k == 0:
			b = b - k
			if m < l:
				a = a - m
			else:
				a = a - l
		elif l < 0:
			b = b - n
		pb = a * b
	a = za
	b = zb
	if n > 0:
		k = b - y
		l = n - k
		m = a - x
		if l >= 0 or k == 0:
			b = b - k
			if m < l:
				a = a - m
			else:
				a = a - l
		elif l < 0:
			b = b - n
		pc = a * b
	print(min(pa, pb, pc))


def getMin(a, b, x, y, n):
	return min(solve(a, b, x, y, n), solve(b, a, y, x, n))

def solve(a, b, x, y, n):
	sub = a - n
	a = max(sub, x)
	n = a - sub
	b = max(b - n, y)
	return a * b
testCases = input()
for i in range(int(testCases)):
	(a, b, x, y, n) = map(int, input().split())
	ans = getMin(a, b, x, y, n)
	print(ans)


def _solve(a, b, x, y, n):
	c1 = min(a - x, n)
	a -= c1
	n -= c1
	c2 = min(b - y, n)
	b -= c2
	n -= c2
	return a * b
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(_solve(a, b, x, y, n), _solve(b, a, y, x, n)))


T = int(input())
for case in range(T):
	(a, b, x, y, n) = map(int, input().split())
	a1 = max(a - n, x)
	b1 = max(b - (n - (a - a1)), y)
	b2 = max(b - n, y)
	a2 = max(a - (n - (b - b2)), x)
	print(min(a1 * b1, a2 * b2))


def calc(a, b, x, y, n):
	temp = min(a - x, n)
	a = a - temp
	n -= temp
	b = b - min(b - y, n)
	return a * b
t = int(input())
for i in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	ans = min(calc(a, b, x, y, n), calc(b, a, y, x, n))
	print(ans)


def min_prod(arr):
	a = arr[0]
	b = arr[1]
	x = arr[2]
	y = arr[3]
	n = arr[4]
	if b - y < n:
		n1 = y
		if a - x < n - (b - y):
			n2 = x
		else:
			n2 = a - (n - (b - y))
		p1 = n1 * n2
	else:
		n1 = b - n
		p1 = a * n1
	if a - x < n:
		n2 = x
		if b - y < n - (a - x):
			n1 = y
		else:
			n1 = b - (n - (a - x))
		p2 = n1 * n2
	else:
		n2 = a - n
		p2 = b * n2
	m = min(p1, p2)
	return m
t = int(input())
for _ in range(t):
	arr = list(map(int, input().split()))
	print(min_prod(arr))


for u in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	t = n
	aa = a
	bb = b
	ka = min(a - x, n)
	n -= ka
	a -= ka
	ka = min(b - y, n)
	b -= ka
	r = a * b
	n = t
	a = aa
	b = bb
	ka = min(b - y, n)
	b -= ka
	n -= ka
	ka = min(a - x, n)
	a -= ka
	r = min(r, a * b)
	print(r)


import sys
import math

def aThenB(a, b, x, y, n, n1=0):
	nComp = n1
	minA = a - n
	if minA < x:
		nComp += n - (a - x)
		minA = x
	elif minA == x:
		return minA * b
	minB = b - nComp
	if minB < y:
		minB = y
		return minA * minB
	else:
		return minA * minB

def bThenA(a, b, x, y, n, n1=0):
	nComp = n1
	minB = b - n
	if minB < y:
		nComp += n - (b - y)
		minB = y
	elif minB == y:
		return a * minB
	minA = a - nComp
	if minA < x:
		minA = x
		return minA * minB
	else:
		return minA * minB
inputs = []
res = []
userIn = int(input())
for i in range(0, userIn):
	(a, b, x, y, n) = input().split()
	x = [a, b, x, y, n]
	inputs.append(x)
for i in range(0, len(inputs)):
	a = int(inputs[i][0])
	b = int(inputs[i][1])
	x = int(inputs[i][2])
	y = int(inputs[i][3])
	n = int(inputs[i][4])
	nLeft = 0
	aB = aThenB(a, b, x, y, n)
	bA = bThenA(a, b, x, y, n)
	res.append(min(aB, bA))
for i in range(0, len(res)):
	print(res[i])


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if max(a - n, x) > max(b - n, y):
		if b - n > y:
			b = b - n
			n = 0
		else:
			n -= b - y
			b = y
			if a - n > x:
				a -= n
			else:
				a = x
	elif a - n > x:
		a = a - n
		n = 0
	else:
		n -= a - x
		a = x
		if b - n > y:
			b -= n
		else:
			b = y
	print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	c = n
	if b > a:
		(a, b, x, y) = (b, a, y, x)
	if max(x, a - c) > max(y, b - c):
		if b - y >= c:
			b = b - c
			print(a * b)
			continue
		else:
			c = c - (b - y)
			b = y
			a = max(x, a - c)
			print(a * b)
	elif a - x >= c:
		a = a - c
		print(a * b)
		continue
	else:
		c = c - (a - x)
		a = x
		b = max(y, b - c)
		print(a * b)


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
for __ in range(itg()):
	(a, b, x, y, n) = mpint()
	min_a = max(x, a - n)
	min_b = max(y, b - n)
	if min_a < min_b:
		op = a - min_a
		op = n - op
		b = max(y, b - op)
		print(min_a * b)
	else:
		op = b - min_b
		op = n - op
		a = max(x, a - op)
		print(min_b * a)


def solve(n1, n2, n11, n22, n):
	diff = n1 - n11
	if diff > 0:
		if n > diff:
			d = n1 - n11
			n1 = n11
			n -= d
		elif n == diff:
			n = 0
			n1 = n11
		else:
			n1 -= n
			n = 0
	diff = n2 - n22
	if diff > 0:
		if n > diff:
			d = n2 - n22
			n2 = n22
			n -= d
		elif n == diff:
			n = 0
			n2 = n22
		else:
			n2 -= n
			n = 0
	return n1 * n2

def solved(n1, n2, n11, n22, n):
	diff = n2 - n22
	if diff > 0:
		if n > diff:
			d = n2 - n22
			n2 = n22
			n -= d
		elif n == diff:
			n = 0
			n2 = n22
		else:
			n2 -= n
			n = 0
	diff = n1 - n11
	if diff > 0:
		if n > diff:
			d = n1 - n11
			n1 = n11
			n -= d
		elif n == diff:
			n = 0
			n1 = n11
		else:
			n1 -= n
			n = 0
	return n1 * n2
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a != b:
		if a < b:
			ans = solve(a, b, x, y, n)
			ans1 = solved(a, b, x, y, n)
			print(min(ans, ans1))
		else:
			ans = solve(a, b, x, y, n)
			ans1 = solved(a, b, x, y, n)
			print(min(ans, ans1))
	else:
		ans = solve(a, b, x, y, n)
		ans1 = solved(a, b, x, y, n)
		print(min(ans, ans1))


from math import *
t = int(input())
while t:
	t = t - 1
	(a, b, x, y, n) = map(int, input().split())
	l = [[a, x], [b, y]]
	l.sort()
	a = l[0][0]
	bb = a
	x = a - l[0][1]
	yy = x
	b = l[1][0]
	aa = b
	y = b - l[1][1]
	xx = y
	nn = n
	mn = min(n, x)
	a = a - mn
	n = n - mn
	b = b - min(y, n)
	mn = min(nn, xx)
	aa = aa - mn
	nn = nn - mn
	bb = bb - min(yy, nn)
	print(min(a * b, aa * bb))


def prog_name():
	(a, b, x, y, n) = map(int, input().split())
	ans1 = ans2 = 0
	tempa = a
	tempb = b
	tempn = n
	if tempn > tempa - x:
		tempn -= tempa - x
		tempa = x
	else:
		tempa -= tempn
		tempn = 0
	if tempn <= 0:
		ans1 = tempa * tempb
	else:
		if tempn > tempb - y:
			tempn -= tempb - y
			tempb = y
		else:
			tempb -= tempn
		ans1 = tempa * tempb
	if n > b - y:
		n -= b - y
		b = y
	else:
		b -= n
		n = 0
	if n <= 0:
		ans2 = a * b
	else:
		if n > a - x:
			n -= a - x
			a = x
		else:
			a -= n
		ans2 = a * b
	print(min(ans1, ans2))
t = int(input())
for unique in range(t):
	prog_name()


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	num1 = a * b
	num2 = a * b
	ha = a
	hb = b
	c = a - x
	d = b - y
	if c + d <= n:
		a = a - c
		b = b - d
		print(a * b)
	else:
		if c >= n:
			a = a - n
		else:
			a = a - c
			b = b - (n - c)
		if a >= x and b >= y:
			num1 = a * b
		a = ha
		b = hb
		if d >= n:
			b = b - n
		else:
			b = b - d
			a = a - (n - d)
		if a >= x and b >= y:
			num2 = a * b
		a = ha
		b = hb
		num3 = num2
		num4 = num2
		if n % 2 == 0:
			if c > n // 2 and d > n // 2:
				a = a - n // 2
				b = b - n // 2
				if a >= x and b >= y:
					num3 = a * b
		else:
			if c > n // 2 and d > n // 2 + 1:
				a = a - n // 2
				b = b - (n // 2 + 1)
				if a >= x and b >= y:
					num4 = a * b
			a = ha
			b = hb
			if c > n // 2 + 1 and d > n // 2:
				a = a - (n // 2 + 1)
				b = b - n // 2
				if a >= x and b >= y:
					num4 = min(num4, a * b)
		print(min(min(num1, num2), min(num3, num4)))


t = int(input())
for _ipj_ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if b > a:
		(a, b) = (b, a)
		(x, y) = (y, x)
	ans1 = ans2 = ans3 = ans4 = 1000000000000000000000
	if n > b - y:
		n1 = n - (b - y)
		b1 = y
		a1 = a - n1
		if a1 < x:
			a1 = x
		ans1 = a1 * b1
	else:
		ans3 = a * (b - n)
	if n > a - x:
		n1 = n - (a - x)
		a1 = x
		b1 = b - n1
		if b1 < y:
			b1 = y
		ans2 = a1 * b1
	else:
		ans4 = b * (a - n)
	print(min(a * b, ans1, ans2, ans3, ans4))


t = int(input())
for h in range(t):
	(a, b, x, y, n) = map(int, input().split())
	st = []
	if a != b:
		if a - n < x:
			h1 = x
			h2 = b - (n - (a - x))
			if h2 < y:
				h2 = y
			st.append(h1 * h2)
		else:
			h1 = a - n
			st.append(h1 * b)
		(a, b) = (b, a)
		(x, y) = (y, x)
		if a - n < x:
			h1 = x
			h2 = b - (n - (a - x))
			if h2 < y:
				h2 = y
			st.append(h1 * h2)
		else:
			h1 = a - n
			st.append(h1 * b)
	elif x < y:
		if a - n < x:
			h1 = x
			h2 = b - (n - (a - x))
			if h2 < y:
				h2 = y
			st.append(h1 * h2)
		else:
			h1 = a - n
			st.append(h1 * b)
	else:
		(x, y) = (y, x)
		if a - n < x:
			h1 = x
			h2 = b - (n - (a - x))
			if h2 < y:
				h2 = y
			st.append(h1 * h2)
		else:
			h1 = a - n
			st.append(h1 * b)
	print(min(st))


t = int(input())
tasks = []
for i in range(t):
	tasks.append(list(map(int, input().split())))
for i in range(t):
	mins = []
	(a, b, x, y, n) = tasks[i]
	if a - x >= n:
		a -= n
		mins.append(a * b)
	else:
		n -= a - x
		a = x
		b = max(b - n, y)
		mins.append(a * b)
	(a, b, x, y, n) = tasks[i]
	if b - y >= n:
		b -= n
		mins.append(a * b)
	else:
		n -= b - y
		b = y
		a = max(a - n, x)
		mins.append(a * b)
	print(min(mins))


import sys

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

def getInt():
	return int(input())

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

def getIntList():
	return list(getIntIter())
for _ in range(int(input())):
	(a, b, x, y, n) = getIntIter()
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a == b and x > y:
		(x, y) = (y, x)
	if a - x + b - y <= n:
		print(x * y)
	elif a - n >= x:
		print((a - n) * b)
	else:
		a1 = max(x, a - n)
		b1 = a + b - n - a1
		b2 = max(y, b - n)
		a2 = a + b - n - b2
		print(min(a1 * b1, a2 * b2))


t = int(input())
while t > 0:
	(a, b, x, y, n) = input().split(' ')
	a1 = int(a)
	a = int(a)
	b1 = int(b)
	b = int(b)
	x1 = int(x)
	x = int(x)
	y1 = int(y)
	y = int(y)
	n1 = int(n)
	n = int(n)
	sub = b - y
	b = b - min(sub, n)
	n = n - min(sub, n)
	a = a - min(n, a - x)
	ans = a * b
	sub = a1 - x1
	a1 = a1 - min(sub, n1)
	n1 = n1 - min(sub, n1)
	b1 = b1 - min(n1, b1 - y1)
	print(min(a1 * b1, ans))
	t -= 1


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(max_ax, max_by) = (max(a - n, x), max(b - n, y))
	print(min(max_ax * max(a - n - max_ax + b, y), max_by * max(a - n - max_by + b, x)))


for i in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	m = n
	if b < a:
		(a, b) = (b, a)
		(x, y) = (y, x)
	c1 = max(a - n, x)
	n -= a - c1
	d1 = max(b - n, y)
	c2 = max(b - m, y)
	m -= b - c2
	d2 = max(a - m, x)
	print(min(c1 * d1, c2 * d2))


t = int(input())
for i in range(t):
	l = list(map(int, input().strip().split()))
	a = l[0]
	b = l[1]
	x = l[2]
	y = l[3]
	n = l[4]
	e = a - x
	f = b - y
	n1 = n
	a1 = a
	b1 = b
	res = 99999999999999999999
	if e < n:
		n = n - e
		a1 = a1 - e
		if f < n:
			n = n - f
			b1 = b1 - f
		else:
			b1 = b1 - n
			n = 0
	else:
		a1 = a1 - n
		n = 0
	res = min(res, a1 * b1)
	e = a - x
	f = b - y
	if f < n1:
		n1 = n1 - f
		b = b - f
		if e < n1:
			n1 = n1 - e
			a = a - e
		else:
			a = a - n1
			n1 = 0
	else:
		b = b - n1
		n1 = 0
	res = min(res, a * b)
	print(res)


p = print
z = input
for _ in range(int(z())):
	(a, b, x, y, n) = map(int, z().split())
	l = [(a, x), (b, y)]
	(c, d) = min(l)
	(e, f) = max(l)
	if n <= c - d:
		p((c - n) * e)
	elif n <= a - x + b - y:
		if n <= e - f:
			p(min(d * (e - n - d + c), (e - n) * c))
		else:
			p(min(x * (b - n - x + a), y * (a - n - y + b)))
	else:
		p(x * y)


def slash(ran, n):
	if ran >= n:
		return (ran - n, 0)
	else:
		return (0, n - ran)
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a == x and b == y:
		print(a * b)
		continue
	(ty, tn) = slash(b - y, n)
	(tx, xn) = slash(a - x, n)
	if x + tx > ty + y:
		(x, y) = (y, x)
		(a, b) = (b, a)
	xr = a - x
	yr = b - y
	(xr, n) = slash(xr, n)
	if n == 0:
		print((x + xr) * b)
	elif xr == 0:
		(yr, n) = slash(yr, n)
		print(x * (y + yr))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ra = max(a - n, x)
	rb = max(b - n, y)
	if ra < rb:
		o = n - a + ra
		b = b - o
		print(ra * max(y, b))
	else:
		o = n - b + rb
		a = a - o
		print(rb * max(x, a))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	min_a = max(a - n, x)
	min_b = max(b - n, y)
	if min_a < min_b:
		n = n - (a - min_a)
		a = min_a
		b = max(b - n, y)
	else:
		n = n - (b - min_b)
		b = min_b
		a = max(a - n, x)
	print(a * b)


from sys import stdin, stdout
from collections import Counter, OrderedDict
import math
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))

def chars():
	s = cin()
	return list(s[:len(s) - 1])

def pl(a):
	for val in a:
		cout(str(val))
	cout('\n')

def f1():
	b2 = max(y, b - n)
	n2 = n - b + b2
	a2 = max(x, a - n2)
	return a2 * b2

def f2():
	a2 = max(x, a - n)
	n2 = n - a + a2
	b2 = max(y, b - n2)
	return a2 * b2
(t,) = mp()
for _ in range(t):
	(a, b, x, y, n) = mp()
	p = max(x, a - n)
	q = max(y, b - n)
	if p <= q:
		n = n - a + p
		q = max(y, b - n)
	elif q < p:
		n = n - b + q
		p = max(x, a - n)
	pl([p * q])


t = int(input())
for i in range(t):
	(a, b, x, y, n) = tuple(map(int, input().split()))
	min_possible_a = max(a - n, x)
	min_possible_b = max(b - n, y)
	if min_possible_a > min_possible_b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	to_x = a - x
	to_y = b - y
	if n > to_x:
		a = x
		n -= to_x
		if n > to_y:
			b = y
		else:
			b -= n
	else:
		a -= n
	print(a * b)


def inp_n():
	return int(input())

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

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

def is_odd(n):
	if n & 1:
		return True
	return False

def is_prime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
from collections import defaultdict
import math

def foo(a, b, x, y, n):
	m = min(a - x, n)
	a -= m
	n -= m
	m = min(b - y, n)
	b -= m
	return a * b
for _ in range(inp_n()):
	(a, b, x, y, n) = inp_mul_num()
	print(min(foo(a, b, x, y, n), foo(b, a, y, x, n)))


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	(a1, b1) = (b, a)
	n1 = n
	if a - x >= n:
		a = a - n
		n = 0
	else:
		n = n - (a - x)
		a = x
	if n != 0:
		if b - y < n:
			b = y
		else:
			b -= n
	if a1 - y >= n1:
		a1 = a1 - n1
		n1 = 0
	else:
		n1 = n1 - (a1 - y)
		a1 = y
	if n1 != 0:
		if b1 - x < n1:
			b1 = x
		else:
			b1 -= n1
	print(min(a * b, a1 * b1))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 1e+20
	for _ in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b, x, y) = (b, a, y, x)
	if ans < 0:
		ans = x * y
	print(ans)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	if n >= a - x + (b - y):
		print(x * y)
	else:
		m1 = n - (a - x)
		m2 = n - (b - y)
		l1 = []
		l2 = []
		if m1 > 0:
			l1.append(x)
			l1.append(b - m1)
		else:
			l1.append(a - n)
			l1.append(b)
		if m2 > 0:
			l2.append(y)
			l2.append(a - m2)
		else:
			l2.append(b - n)
			l2.append(a)
		if min(l1) < min(l2):
			print(l1[0] * l1[1])
		else:
			print(l2[0] * l2[1])


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


t = int(input())

def minimum(a, b, x, y, n):
	temp = max(a - n, x)
	if temp == x:
		p1 = temp * max(y, b - (n - a + x))
	else:
		p1 = temp * b
	temp = max(b - n, y)
	if temp == y:
		p2 = temp * max(x, a - (n - b + y))
	else:
		p2 = temp * a
	return min(p1, p2)
for i in range(t):
	(a, b, x, y, n) = input().split()
	print(minimum(int(a), int(b), int(x), int(y), int(n)))


t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	if x < y:
		(y, x) = (x, y)
		(a, b) = (b, a)
	(ta, tb, tn) = (a, b, n)
	mn = tb - max(b - tn, y)
	tn -= mn
	tb -= mn
	mn = a - max(ta - tn, x)
	ta -= mn
	ans = ta * tb
	(ta, tb, tn) = (a, b, n)
	mn = a - max(ta - tn, x)
	ta -= mn
	tn -= mn
	mn = tb - max(b - tn, y)
	tb -= mn
	ans = min(ans, ta * tb)
	print(ans)
	t -= 1


import sys
input = sys.stdin.readline

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

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

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

def invr():
	return map(int, input().split())
fast = inp()
l = []
for i in range(fast):
	(a, b, x, y, n) = invr()
	na = a
	nb = b
	nx = x
	ny = y
	nn = n
	na = na - nn
	if na < nx:
		nb = nb - (nx - na)
		na += nx - na
	if nb < ny:
		nb = ny
	resultone = na * nb
	b = b - n
	if b < y:
		a = a - (y - b)
		b += y - b
	if a < x:
		a = x
	resulttwo = a * b
	if resultone > resulttwo:
		l.append(resulttwo)
	else:
		l.append(resultone)
for i in l:
	print(i)


m = int(input())
for i in range(m):
	a = list(map(int, input().split()))
	n = a[4]
	b = [a[0], a[2], 0, 0]
	c = [a[1], a[3], 0, 0]
	b[2] = b[0] - n
	b[3] = 0
	if b[2] < b[1]:
		b[3] = b[1] - b[2]
		b[2] = b[1]
	c[2] = c[0] - n
	c[3] = 0
	if c[2] < c[1]:
		c[3] = c[1] - c[2]
		c[2] = c[1]
	if b[2] < c[2]:
		print(b[2] * max(c[0] - b[3], c[2]))
	else:
		print(c[2] * max(b[0] - c[3], b[2]))


T = lambda : range(int(input()))
A = lambda : list(map(int, input().split()))
for _ in T():
	(a, b, x, y, n) = A()
	if a == x and b == y:
		print(a * b)
	else:
		s1 = a - n
		if s1 >= x:
			p1 = s1 * b
		else:
			s11 = b - (n - (a - x))
			if s11 >= y:
				p1 = x * s11
			else:
				p1 = x * y
				print(p1)
				continue
		s2 = b - n
		if s2 >= y:
			p2 = a * s2
		else:
			s22 = a - (n - (b - y))
			if s22 >= x:
				p2 = s22 * y
			else:
				p2 = x * y
				print(p2)
				continue
		print(min(p1, p2))


cases = int(input())
for _ in range(cases):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1) = (a, b)
	p1 = min(a - x, n)
	a -= p1
	r = n - p1
	b -= min(r, b - y)
	g1 = a * b
	p2 = min(b1 - y, n)
	b1 -= p2
	r = n - p2
	a1 -= min(r, a1 - x)
	g2 = a1 * b1
	print(min(g1, g2))


def ok(a, b, x, y, n):
	diff = a - x
	if n >= diff:
		n = n - diff
	else:
		a = a - n
		return a * b
	a = x
	if n <= 0:
		return a * b
	diff1 = b - y
	if n >= diff1:
		b = y
		return a * b
	else:
		b = b - n
	return a * b
n = int(input())
for i in range(n):
	(a, b, x, y, n) = map(int, input().split())
	ans = min(ok(a, b, x, y, n), ok(b, a, y, x, n))
	print(ans)


out = []
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - min(a - x, n) < b - min(b - y, n):
		(a, b) = (b, a)
		(x, y) = (y, x)
	d = min(b - y, n)
	b -= d
	n -= d
	a -= min(a - x, n)
	out.append(str(a * b))
print('\n'.join(out))


t = int(input())

def solve(a, b, x, y, n):
	d1 = a - x
	d2 = b - y
	c1 = min(d1, n)
	a -= c1
	n -= c1
	c2 = min(d2, n)
	b -= c2
	n -= c2
	ans = a * b
	return ans
while t:
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))
	t -= 1


n = int(input())
for i in range(n):
	(a, b, c, d, n) = map(int, input().split())
	a1 = a - n if a - c > n else c
	b1 = b - (n - (a - a1))
	b1 = d if b1 < d else b1
	b2 = b - n if b - d > n else d
	a2 = a - (n - (b - b2))
	a2 = c if a2 < c else a2
	print(min(a1 * b1, a2 * b2))


def process(a, b, x, y, n):
	if n >= a - x + b - y:
		return x * y
	tmp = max(a - n, x)
	n -= a - tmp
	a = tmp
	b = max(b - n, y)
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = [int(t) for t in input().split()]
	print(min(process(a, b, x, y, n), process(b, a, y, x, n)))


def calcualteMin(a, b, x, y, n):
	exitA1 = a
	exitB1 = b
	exitA2 = a
	exitB2 = b
	firstRemain = 0
	exitA1 = a - n
	if exitA1 < x:
		firstRemain = x - exitA1
		exitA1 = x
	exitB1 = b - firstRemain
	if exitB1 < y:
		exitB1 = y
	secondRemain = 0
	exitB2 = b - n
	if exitB2 < y:
		secondRemain = y - exitB2
		exitB2 = y
	exitA2 = a - secondRemain
	if exitA2 < x:
		exitA2 = x
	return min([exitA1 * exitB1, exitA2 * exitB2])
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split(' '))
	print(calcualteMin(a, b, x, y, n))


def f(a, b, x, y):
	return max(x, a - n) * max(y, b - max(n - a + x, 0))
for s in [*open(0)][1:]:
	(a, b, x, y, n) = map(int, s.split())
	print(min(f(a, b, x, y), f(b, a, y, x)))


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

def get_int():
	return int(stdin.readline().strip())

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

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

def fun(a, b, x, y, n):
	red1 = min(n, a - x)
	n -= red1
	a -= red1
	red2 = min(n, b - y)
	b -= red2
	n -= red2
	return a * b

def solve():
	(a, b, x, y, n) = get_tuple()
	print(min(fun(a, b, x, y, n), fun(b, a, y, x, n)))

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


t = int(input())
l = []
for _ in range(t):
	ans = 0
	(a, b, x, y, n) = [int(i) for i in input().split()]
	(n1, n2) = (n, n)
	if b - y >= n1:
		ans1 = a * (b - n1)
	else:
		n1 -= b - y
		if a - x >= n1:
			ans1 = y * (a - n1)
		else:
			ans1 = y * x
	if a - x >= n2:
		ans2 = b * (a - n2)
	else:
		n2 -= a - x
		if b - y >= n2:
			ans2 = x * (b - n2)
		else:
			ans2 = x * y
	ans = min(ans1, ans2)
	l.append(ans)
for i in l:
	print(i)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	da = min(n, a - x)
	db = min(n - da, b - y)
	ax = a - da
	by = b - db
	(a, b) = (b, a)
	(x, y) = (y, x)
	da = min(n, a - x)
	db = min(n - da, b - y)
	axx = a - da
	byy = b - db
	print(min(ax * by, axx * byy))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	res = float('inf')
	if n <= a - x:
		res = b * (a - n)
	else:
		res = min(res, x * max(y, b - (n - a + x)))
	if n <= b - y:
		res = min(res, a * (b - n))
	else:
		res = min(res, y * max(x, a - (n - b + y)))
	print(res)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	prod1 = max(a - n, x)
	prod2 = max(b - n, y)
	if prod1 < prod2:
		n -= a - prod1
		prod2 = max(b - n, y)
	else:
		n -= b - prod2
		prod1 = max(a - n, x)
	print(prod1 * prod2)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split())
	m = min(n, a - x)
	a1 = a - m
	n1 = n - m
	b1 = b - min(n1, b - y)
	m = min(n, b - y)
	b2 = b - m
	n2 = n - m
	a2 = a - min(n2, a - x)
	print(min(a1 * b1, a2 * b2))


import math

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

def insr():
	s = input()
	return s

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

def f(a, b, x, y, n):
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if b - y >= n:
		return a * (b - n)
	return min(f2(a, b, x, y, n), f2(b, a, y, x, n))

def f2(a, b, x, y, n):
	final = max(a - n, x)
	final2 = max(b - (n - (a - final)), y)
	return final * final2
r = inp()
for i in range(r):
	l2 = inlt()
	print(f(l2[0], l2[1], l2[2], l2[3], l2[4]))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	c = a
	d = b
	k = n
	if a - n <= x:
		n -= a - x
		a = x
		if b - n <= y:
			b = y
			temp = a * b
		else:
			b -= n
			temp = a * b
	else:
		temp = (a - n) * b
	(a, b) = (d, c)
	(x, y) = (y, x)
	n = k
	if a - n <= x:
		n -= a - x
		a = x
		if b - n <= y:
			b = y
			targ = a * b
		else:
			b -= n
			targ = a * b
	else:
		targ = (a - n) * b
	print(min(targ, temp))


def l(a, b, x, y, n):
	k = min(a - x, n)
	a -= k
	n -= k
	k = min(b - y, n)
	b -= k
	n -= k
	return a * b

def r(a, b, x, y, n):
	k = min(b - y, n)
	b -= k
	n -= k
	k = min(a - x, n)
	a -= k
	n -= k
	return a * b
for _ in ' ' * int(input()):
	(a, b, x, y, n) = map(int, input().split())
	print(min(l(a, b, x, y, n), r(a, b, x, y, n)))


from functools import lru_cache
import sys
sys.setrecursionlimit(1000000)
t = int(input())
while t:
	(a, b, x, y, n) = tuple(map(int, input().split()))
	n1 = n
	n2 = n
	dif1 = a - x
	dif2 = b - y
	ch1 = min(n1, dif1)
	n1 = n1 - ch1
	ch2 = min(n1, dif2)
	ans1 = (a - ch1) * (b - ch2)
	ch2 = min(n2, dif2)
	n2 = n2 - ch2
	ch1 = min(n2, dif1)
	ans2 = (a - ch1) * (b - ch2)
	print(min(ans2, ans1))
	t -= 1


t = int(input())
for i in range(t):
	(a, b, x, y, n) = input().split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	if n >= a - x + b - y:
		print(x * y)
	else:
		if a - x >= n:
			s1 = (a - n) * b
		else:
			s1 = x * (b - (n - a + x))
		if b - y >= n:
			s3 = a * (b - n)
		else:
			s3 = (a - (n - b + y)) * y
		print(min(s1, s3))


t = int(input())
for _ in range(t):
	(a, b, x, y, k) = map(int, input().split())
	if a <= b:
		if a - x >= k:
			print((a - k) * b)
		elif b - y >= k:
			if x >= b - k:
				print(a * (b - k))
			else:
				diff = a - x
				a = x
				k = k - diff
				if b - k > y:
					print(a * (b - k))
				else:
					print(a * y)
		elif x <= y:
			diff = a - x
			a = x
			k -= diff
			if b - k > y:
				print(a * (b - k))
			else:
				print(a * y)
		else:
			diff = b - y
			b = y
			k -= diff
			if a - k >= x:
				print((a - k) * b)
			else:
				print(x * b)
	elif b - y >= k:
		print((b - k) * a)
	elif a - x >= k:
		if y >= a - k:
			print(b * (a - k))
		else:
			diff = b - y
			b = y
			k -= diff
			if a - k >= x:
				print(b * (a - k))
			else:
				print(b * x)
	elif y <= x:
		diff = b - y
		b = y
		k -= diff
		if a - k >= x:
			print(b * (a - k))
		else:
			print(b * x)
	else:
		diff = a - x
		a = x
		k -= diff
		if b - k >= y:
			print((b - k) * a)
		else:
			print(y * a)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 10 ** 18 + 1
	for i in range(2):
		A = min(n, a - x)
		B = min(n - A, b - y)
		ans = min(ans, (a - A) * (b - B))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


from sys import stdin
tc = int(stdin.readline())
for t in range(tc):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	ma = min(a - x, n)
	mb = min(b - y, n)
	if a - ma < b - mb:
		a = a - ma
		n = n - ma
		mb = min(b - y, n)
		b = b - mb
	else:
		b = b - mb
		n = n - mb
		ma = min(a - x, n)
		a = a - ma
	print(a * b)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
inf = 10 ** 20
mod = 10 ** 9 + 7

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

def II():
	return int(input())

def LS():
	return list(input().split())

def S():
	return input()

def solve():
	(a, b, x, y, n) = LI()
	ans = inf
	if a - n >= x:
		ans = min(ans, (a - n) * b)
	if b - n >= y:
		ans = min(ans, a * (b - n))
	tmp = n - (b - y)
	if 0 <= b - y <= n:
		tmp2 = max(x, a - tmp)
		ans = min(ans, tmp2 * y)
	tmp = n - (a - x)
	if 0 <= a - x <= n:
		tmp2 = max(y, b - tmp)
		ans = min(ans, tmp2 * x)
	return ans

def main():
	t = II()
	res = list()
	for _ in range(t):
		res.append(solve())
	for ans in res:
		print(ans)
	return 0
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if True:
		var = min(a1 - x1, n1)
		a1 -= var
		n1 -= var
		var = min(b1 - y1, n1)
		b1 -= var
		n1 -= var
	if True:
		var = min(b - y, n)
		b -= var
		n -= var
		var = min(a - x, n)
		a -= var
		n -= var
	print(min(a1 * b1, a * b))


import math

def find(a, b, x, y, n):
	(n, a) = (n - min(n, a - x), a - min(n, a - x))
	(n, b) = (n - min(n, b - y), b - min(n, b - y))
	return a * b

def main():
	for _ in range(int(input())):
		(a, b, x, y, n) = map(int, input().split())
		print(min(find(a, b, x, y, n), find(b, a, y, x, n)))
main()


import sys
from sys import stdin
import math

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

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

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

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

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

def flinput():
	return list(map(int, stdin.readline().strip().split()))
for _ in range(iinput()):
	(a, b, x, y, n) = minput()
	m1 = 0
	m2 = 0
	a1 = a
	b1 = b
	nn = n
	aa = a
	a = max(a - n, x)
	n = n - (aa - a)
	b = max(b - n, y)
	m1 = a * b
	a = a1
	b = b1
	n = nn
	bb = b
	b = max(b - n, y)
	n = n - (bb - b)
	a = max(a - n, x)
	m2 = a * b
	print(min(m1, m2))


t = int(input())
while t > 0:
	(a, b, x, y, n) = [int(a) for a in input().split()]
	z1 = min(a - x, n)
	z2 = min(b - y, n)
	a1 = a - z1
	b1 = b - z2
	if a1 <= b1:
		a = a1
		b = max(b - (n - z1), y)
	else:
		b = b1
		a = max(a - (n - z2), x)
	print(a * b)
	t -= 1


T = int(input())
for case in range(T):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		num1 = max(a - n, x)
		num2 = b
		if num1 == x:
			num2 = b - n + a - x
		prod1 = num1 * num2
		num2 = max(b - n, y)
		num1 = a
		if num2 == y:
			num1 = a - n + b - y
		prod2 = num1 * num2
		print(min(prod1, prod2))


def solve(a, b, x, y, n):
	diff_a = min(a - x, n)
	a -= diff_a
	n -= diff_a
	diff_b = min(b - y, n)
	b -= diff_b
	return a * b
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	check1 = solve(a, b, x, y, n)
	check2 = solve(b, a, y, x, n)
	print(min(check1, check2))


def fun1(a, b, x, y, n):
	diff1 = a - x
	diff2 = b - y
	if diff1 >= n:
		a -= n
	else:
		a -= diff1
		n -= diff1
		if diff2 >= n:
			b -= n
		else:
			b -= diff2
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(t1, t2) = (a, b)
	ans1 = fun1(a, b, x, y, n)
	ans2 = fun1(t2, t1, y, x, n)
	print(min(ans1, ans2))


t = int(input())
as1 = as2 = 0
while True:
	if t == 0:
		break
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	as1 = as2 = 0
	if n >= a - x:
		as1 = x * (b - min(b - y, n - a + x))
	else:
		as1 = (a - n) * b
	if n >= b - y:
		as2 = y * (a - min(a - x, n - b + y))
	else:
		as2 = (b - n) * a
	print(min(as1, as2))


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	if x > y:
		(x, y) = (y, x)
		(a, b) = (b, a)
	aa = a
	bb = b
	nn = n
	mi = min(b - y, n)
	b -= mi
	n -= mi
	mi = min(a - x, n)
	a -= mi
	ans = a * b
	mi = min(aa - x, nn)
	aa -= mi
	nn -= mi
	mi = min(bb - y, nn)
	bb -= mi
	print(min(ans, aa * bb))
	t -= 1


from copy import copy

def get_int():
	return int(input())

def get_ints():
	return [int(item) for item in input().split(' ')]

def get_str():
	return input()

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

def main():
	t = get_int()
	for _ in range(t):
		(a, b, x, y, n) = get_ints()
		if a > b:
			(a, b) = (b, a)
			(x, y) = (y, x)
		(ca, cb) = (copy(a), copy(b))
		diff = min(a - x, n)
		inverse_diff = n - diff
		a -= diff
		b -= min(b - y, inverse_diff)
		diff = min(cb - y, n)
		inverse_diff = n - diff
		cb -= diff
		ca -= min(ca - x, inverse_diff)
		print(min(a * b, ca * cb))
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())

	def min_pdt(a, b, x, y, n):
		da = min(a - x, n)
		a = a - da
		n = n - da
		db = min(b - y, n)
		b = b - db
		return a * b
	print(min(min_pdt(a, b, x, y, n), min_pdt(b, a, y, x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	aa = a
	bb = b
	nn = n
	pp = min(aa - x, n)
	nn -= pp
	aa -= pp
	if nn > 0:
		qq = min(bb - y, nn)
		bb -= qq
	pp = min(b - y, n)
	n -= pp
	b -= pp
	if n > 0:
		qq = min(a - x, n)
		a -= qq
	print(min(aa * bb, a * b))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	x_left = a - x if a - x < n else n
	y_left = b - y if b - y < n else n
	if a - x + b - y < n:
		print(x * y)
	else:
		nx = n - x_left if n - x_left > 0 else 0
		ny = n - y_left if n - y_left > 0 else 0
		s1 = (a - x_left) * (b - nx)
		s2 = (b - y_left) * (a - ny)
		print(min(s1, s2))


import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	mi = math.inf
	if a - x + b - y <= n:
		mi = min(mi, a * b)
	if a - x <= n:
		mi = min(mi, x * max(b - (n - a + x), y))
	if b - y <= n:
		mi = min(mi, y * max(a - (n - b + y), x))
	if a - x >= n:
		mi = min(mi, (a - n) * b)
	if b - y >= n:
		mi = min(mi, a * (b - n))
	print(mi)


def cal(a, b, x, y, n):
	n1 = min(a - x, n)
	n2 = min(b - y, n - n1)
	return (a - n1) * (b - n2)
t = int(input())
for cas in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ret = min(cal(a, b, x, y, n), cal(b, a, y, x, n))
	print(ret)


from sys import stdin, stdout
t = int(stdin.readline().strip())
for _ in range(t):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	if a - min(n, a - x) > b - min(n, b - y):
		(a, b) = (b, a)
		(x, y) = (y, x)
	n1 = n - a + x
	a -= min(n, a - x)
	n = n1
	if n >= 0:
		b -= min(n, b - y)
	stdout.write(str(a * b) + '\n')


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	n1 = n + 0
	v1 = min(a - x, n)
	n -= v1
	v2 = min(b - y, n)
	p1 = min(b - y, n1)
	n1 -= p1
	p2 = min(a - x, n1)
	print(min((a - v1) * (b - v2), (b - p1) * (a - p2)))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	mina = min([a - x, n])
	minb = min([b - y, n])
	case1a = a - mina
	case1b = max([b + mina - n, y])
	case2a = max([a + minb - n, x])
	case2b = b - minb
	res = min([case1a * case1b, case2a * case2b])
	print(res)


import sys
rl = sys.stdin.readline
T = int(rl())
while T:
	T -= 1
	(a, b, x, y, n) = [int(i) for i in rl().split()]
	m1 = min(n, a - x)
	m2 = min(n, b - y)
	if a - m1 < b - m2:
		a -= m1
		n -= m1
		b -= min(n, b - y)
	else:
		b -= m2
		n -= m2
		a -= min(n, a - x)
	sys.stdout.write(f'{a * b}\n')


from sys import stdin
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')

def ans(a, b, x, y, n):
	d = min(b - y, n)
	b -= d
	n -= d
	if n:
		d = min(a - x, n)
		n -= d
		a -= d
	return a * b
(t,) = gil()
for _ in range(t):
	(a, b, x, y, n) = gil()
	print(min(ans(a, b, x, y, n), ans(b, a, y, x, n)))


for _ in range(int(input().strip())):
	(a, b, x, y, n) = list(map(int, input().strip().split()))
	diffs = a - x + (b - y)
	ans = x * y
	if diffs <= n:
		print(ans)
		continue
	m = n
	a1 = a
	b1 = b
	a2 = a
	b2 = b
	a1 = max(x, a - m)
	m -= a - a1
	b1 = max(y, b - m)
	m = n
	b2 = max(y, b - m)
	m -= b - b2
	a2 = max(x, a - m)
	ans1 = a1 * b1
	ans2 = a2 * b2
	print(min(ans1, ans2))


for _ in ' ' * int(input()):
	(a, b, x, y, n) = map(int, input().split())
	s = (a - min(a - x, n)) * (b - min(b - y, n - min(a - x, n)))
	s = min((b - min(b - y, n)) * (a - min(a - x, n - min(b - y, n))), s)
	print(s)


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import defaultdict
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

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

def IO():
	return stdin.readline()

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

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

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

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

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

def readTree():
	v = int(input())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return
mod = 10 ** 9 + 7

def solve():
	(a, b, x, y, n) = IP()
	na = max(x, a - n)
	left = n - (a - na)
	if left:
		nb = max(y, b - left)
		ans = na * nb
	else:
		ans = na * b
	nb = max(y, b - n)
	left = n - (b - nb)
	if left:
		na = max(x, a - left)
		ans = min(ans, na * nb)
	else:
		ans = min(ans, nb * a)
	P(ans)
	return
t = II()
for i in range(t):
	solve()


from collections import Counter, defaultdict as dft

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

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

def solve():
	(a, b, x, y, n) = mp()
	xa = a
	xb = b
	xn = n
	take = min(n, b - y)
	n -= take
	b -= take
	take = min(n, a - x)
	n -= take
	a -= take
	r1 = a * b
	(a, b, n) = (xa, xb, xn)
	take = min(n, a - x)
	n -= take
	a -= take
	take = min(n, b - y)
	n -= take
	b -= take
	r2 = a * b
	print(min(r1, r2))
t = int(input())
for _ in range(t):
	solve()


import math

def prod(a, b, x, y, n):
	if a - x >= n:
		return (a - n) * b
	else:
		n = n - (a - x)
		a = x
		if b - y >= n:
			return (b - n) * a
		else:
			return y * a

def prod2(a, b, x, y, n):
	if n > 0:
		if n % 2 == 0 and a > x:
			prod2(a - 1, b, x, y, n - 1)
		elif n % 2 != 0 and b > y:
			prod2(a, b - 1, x, y, n - 1)
		else:
			return a * b
	return a * b

def foc(a, b, x, y, n):
	h1 = prod(a, b, x, y, n)
	h2 = prod(b, a, y, x, n)
	h3 = prod(a, b, x, y, n)
	h4 = prod(b, a, y, x, n)
	return min(h1, h2, h3, h4)
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	print(foc(a, b, x, y, n))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	moves = a - x
	if moves <= n:
		n -= moves
		a = x
		moves2 = b - y
		if moves2 <= n:
			b = y
		else:
			b -= n
	else:
		a -= n
	res1 = a * b
	(a, b, x, y, n) = (a1, b1, x1, y1, n1)
	moves = b - y
	if moves <= n:
		n -= moves
		b = y
		moves2 = a - x
		if moves2 <= n:
			a = x
		else:
			a -= n
	else:
		b -= n
	res2 = a * b
	if res1 <= res2:
		print(res1)
	else:
		print(res2)


import math

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

def btd(n):
	return int(n, 2)
t = int(input())
for k in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if a1 - x1 < n1:
		n1 = n1 - (a1 - x1)
		a1 = x1
		if b1 - y1 < n1:
			b1 = y1
		else:
			b1 = b1 - n1
	else:
		a1 = a1 - n1
	ans = a1 * b1
	if b - y < n:
		n = n - (b - y)
		b = y
		if a - x < n:
			a = x
		else:
			a = a - n
	else:
		b = b - n
	ans = min(ans, a * b)
	print(ans)


for l in [*open(0)][1:]:
	(a, b, x, y, n) = map(int, l.split())
	poss = []
	for (q, w, e, r) in ((a, b, x, y), (b, a, y, x)):
		rem1 = min(q - e, n)
		rem2 = min(w - r, n - rem1)
		poss.append((q - rem1) * (w - rem2))
	print(min(poss))


def answer(a, b, x, y, n):
	ma = max(x, a - n)
	mb = max(y, b - n)
	if ma > mb:
		diff = b - y
		if diff >= n:
			return a * mb
		else:
			return mb * max(x, a - (n - diff))
	else:
		diff = a - x
		if diff >= n:
			return ma * b
		else:
			return ma * max(y, b - (n - diff))
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(answer(a, b, x, y, n))


n = int(input())
arr = []
maxval = []
maxrange = []
for i in range(n):
	cur = arr.append(list(map(int, input().split(' '))))

def check(a, b, x, y, n):
	da = min(n, a - x)
	db = min(n - da, b - y)
	return (a - da) * (b - db)
for j in range(len(arr)):
	(a, b, x, y, n) = (arr[j][0], arr[j][1], arr[j][2], arr[j][3], arr[j][4])
	print(min(check(a, b, x, y, n), check(b, a, y, x, n)))


def input_int():
	return int(input())

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

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

def run():
	q_num = input_int()
	for i in range(q_num):
		(a, b, x, y, n) = input_int_map()
		min_a = max(x, a - n)
		min_b = max(y, b - n)
		if min_a < min_b:
			after_a = min_a
			after_b = max(y, b - (n - (a - min_a)))
		else:
			after_b = min_b
			after_a = max(x, a - (n - (b - min_b)))
		print(after_a * after_b)
run()


from collections import defaultdict as dd, deque
from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	diffa = a - x
	diffb = b - y
	if n >= diffa + diffb:
		print(x * y)
		continue
	else:
		if a == b:
			if diffa > diffb:
				a -= min(n, diffa)
				n -= min(n, diffa)
				if n:
					b -= min(diffb, n)
			else:
				b -= min(n, diffb)
				n -= min(n, diffb)
				if n:
					a -= min(diffa, n)
			print(a * b)
			continue
		acopy = a
		bcopy = b
		acopy -= min(n, diffa)
		bcopy -= min(n, diffb)
		if acopy < bcopy:
			a -= min(n, diffa)
			n -= min(n, diffa)
			if n:
				b -= min(diffb, n)
		else:
			b -= min(n, diffb)
			n -= min(n, diffb)
			if n:
				a -= min(diffa, n)
		print(a * b)


import math
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a2, b2, x2, y2) = (a * 1, b * 1, x * 1, y * 1)
	k = min(n, a - x)
	a -= k
	r = n - k
	b -= min(b - y, r)
	var1 = a * b
	k = min(n, b2 - y2)
	b2 -= k
	r = n - k
	a2 -= min(a2 - x2, r)
	var2 = a2 * b2
	print(min(var1, var2))


def solve(a, b, x, y, n):
	m1 = cal(a, b, x, y, n)
	m2 = cal(b, a, y, x, n)
	return min(m1, m2)

def cal(a, b, x, y, n):
	move1 = min(n, a - x)
	move2 = min(n - move1, b - y)
	ra = a - move1
	rb = b - move2
	return ra * rb
n = int(input())
res = 0
for i in range(n):
	(a, b, x, y, n) = map(int, input().split())
	res = solve(a, b, x, y, n)
	print(res)


import sys

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

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

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

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

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

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

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

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

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7

def check(a, b, x, y, cnt):
	use = min(a - x, cnt)
	a -= use
	cnt -= use
	use = min(b - y, cnt)
	b -= use
	cnt -= use
	return a * b
for _ in range(INT()):
	(a, b, x, y, N) = MAP()
	ans = min(check(a, b, x, y, N), check(b, a, y, x, N))
	print(ans)


import os
import sys
from io import BytesIO, IOBase

def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = map(int, input().split(' '))
		tempa = a
		tempb = b
		tempn = n
		if a - x <= n:
			n = n - abs(a - x)
			a = x
		else:
			a = a - n
			n = 0
		if n > 0:
			b = max(y, b - n)
		ans1 = a * b
		a = tempa
		b = tempb
		n = tempn
		if b - y <= n:
			n = n - abs(b - y)
			b = y
		else:
			b = b - n
			n = 0
		if n > 0:
			a = max(x, a - n)
		print(min(ans1, a * b))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if n > 0 and a != x:
		k = min(a - x, n)
		n -= k
		a -= k
	if n > 0 and b != y:
		k = min(b - y, n)
		b -= k
		n -= k
	mad = a * b
	(a, b, x, y, n) = (a1, b1, x1, y1, n1)
	if n > 0 and b != y:
		k = min(b - y, n)
		b -= k
		n -= k
	if n > 0 and a != x:
		k = min(a - x, n)
		n -= k
		a -= k
	print(min(a * b, mad))


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	if max(a - n, x) <= max(b - n, y):
		temp1 = a
		a = max(a - n, x)
		n -= temp1 - a
		b = max(b - n, y)
		print(a * b)
	else:
		temp1 = b
		b = max(b - n, y)
		n -= temp1 - b
		a = max(a - n, x)
		print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(c, d, i, j, m) = (a, b, x, y, n)
	while m > 0:
		if c == i and d == j:
			break
		elif c > i and i < j:
			k = min(m, c - i)
			m = m - k
			c = c - k
		elif d > j and j < i:
			k = min(m, d - j)
			m = m - k
			d = d - k
		elif c < d and c > i:
			k = min(m, c - i)
			m = m - k
			c = c - k
		elif d < c and d > j:
			k = min(m, d - j)
			m = m - k
			d = d - k
		elif c > i:
			k = min(m, c - i)
			m = m - k
			c = c - k
		elif d > j:
			k = min(m, d - j)
			m = m - k
			d = d - k
	while n > 0:
		if a == x and b == y:
			break
		elif a < b and n > x - a and (x - a != 0):
			k = min(n, a - x)
			n = n - k
			a = a - k
		elif b <= a and n > y - b and (y - b != 0):
			k = min(n, b - y)
			n = n - k
			b = b - k
		elif a > x and x < y:
			k = min(n, a - x)
			n = n - k
			a = a - k
		elif b > y and y < x:
			k = min(n, b - y)
			n = n - k
			b = b - k
		elif a < b and a > x:
			k = min(n, a - x)
			a = a - k
			n = n - k
		elif b < a and b > y:
			k = min(n, b - y)
			b = b - k
			n = n - k
		elif a > x:
			k = min(n, a - x)
			a = a - k
			n = n - k
		elif b > y:
			k = min(n, b - y)
			b = b - k
			n = n - k
	print(min(a * b, c * d))


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
for _ in range(num):
	ans = 0
	(a, b, x, y, n) = zzz()
	t1 = abs(a - x)
	t2 = abs(b - y)
	if a >= b and x >= y:
		b -= min(t2, n)
		n -= min(t2, n)
		a -= min(t1, n)
		print(a * b)
		continue
	elif b >= a and y >= x:
		a -= min(t1, n)
		n -= min(t1, n)
		b -= min(t2, n)
		print(a * b)
		continue
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	a1 -= min(n1, t1)
	n1 -= min(n1, t1)
	b1 -= min(n1, t2)
	b -= min(n, t2)
	n -= min(n, t2)
	a -= min(n, t1)
	print(min(a1 * b1, a * b))


T = int(input())
for i in range(T):
	(a, b, min_a, min_b, n) = input().split()
	a = int(a)
	b = int(b)
	min_a = int(min_a)
	min_b = int(min_b)
	n = int(n)
	mas_bajo_a = max(a - n, min_a)
	mas_bajo_b = max(b - n, min_b)
	if mas_bajo_a < mas_bajo_b:
		n_a = min(a - min_a, n)
		n_b = min(n - n_a, b - min_b)
	else:
		n_b = min(b - min_b, n)
		n_a = min(n - n_b, a - min_a)
	print((a - n_a) * (b - n_b))


import sys

def fun(a, b, x, y, n):
	t = min(n, a - x)
	a = a - t
	n = n - t
	t = min(n, b - y)
	b = b - t
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = fun(a, b, x, y, n)
	a2 = fun(b, a, y, x, n)
	print(min(a1, a2))


import os
from heapq import heapify, heappop, heappush
import sys
import math
import operator
import bisect
from collections import defaultdict
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 5)

def inpt():
	return [int(k) for k in input().split()]

def main():
	for _ in range(int(input())):
		(a, b, x, y, n) = inpt()
		(t1, t2) = (a, b)
		tn = n
		d1 = abs(a - x)
		if d1 > n:
			a -= n
		else:
			a = x
			n -= d1
			d2 = abs(b - y)
			if d2 > n:
				b -= n
			else:
				b = y
		ans1 = a * b
		(a, b) = (t2, t1)
		(x, y) = (y, x)
		n = tn
		d1 = abs(a - x)
		if d1 > n:
			a -= n
		else:
			a = x
			n -= d1
			d2 = abs(b - y)
			if d2 > n:
				b -= n
			else:
				b = y
		ans2 = a * b
		print(min(ans1, ans2))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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


n = int(input())
results = []
for i in range(n):
	abxyt = input().split()
	a = int(abxyt[0])
	b = int(abxyt[1])
	x = int(abxyt[2])
	y = int(abxyt[3])
	t = int(abxyt[4])
	(ac, bc, tc) = (a, b, t)
	(opt1, opt2) = (True, True)
	if opt1:
		a = a - t
		t = 0
		if a < x:
			t = x - a
			a = x
			if t != 0:
				b = b - t
				t = 0
				if b < y:
					t = y - b
					b = y
		r2 = a * b
		(a, b, t) = (ac, bc, tc)
	if opt2:
		b = b - t
		t = 0
		if b < y:
			t = y - b
			b = y
			if t != 0:
				a = a - t
				t = 0
				if a < x:
					t = x - a
					a = x
		r1 = a * b
	if r1 < r2:
		results.append(r1)
	if r1 >= r2:
		results.append(r2)
for r in results:
	print(r)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(m,) = I()
while m:
	m -= 1
	(a, b, x, y, n) = I()
	val = 0
	mini = 1e+20
	t1 = min(n, a - x)
	t2 = min(n - t1, b - y)
	mini = min(mini, (a - t1) * (b - t2))
	t1 = min(n, b - y)
	t2 = min(n - t1, a - x)
	mini = min(mini, (b - t1) * (a - t2))
	print(mini)


def case1(a, b, x, y, n):
	a_diff = min(a - x, n)
	n -= a_diff
	a -= a_diff
	b -= min(b - y, n)
	return a * b

def case2(a, b, x, y, n):
	b_diff = min(b - y, n)
	n -= b_diff
	b -= b_diff
	a -= min(a - x, n)
	return a * b

def solve():
	(a, b, x, y, n) = map(int, input().split())
	print(min(case1(a, b, x, y, n), case2(a, b, x, y, n)))
t = int(input())
for _ in range(t):
	solve()


import math
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	n1 = n
	s1 = 0
	s2 = 0
	if b - y <= n:
		s = b - y
		b = y
		n = n - abs(s)
	else:
		b = b - n
		n = 0
	if n > 0:
		if a - x <= n:
			a = x
		else:
			a = a - n
	if a1 - x <= n1:
		s = a1 - x
		a1 = x
		n1 = n1 - abs(s)
	else:
		a1 = a1 - n1
		n1 = 0
	if n1 > 0:
		if b1 - y <= n1:
			b1 = y
		else:
			b1 = b1 - n1
	print(min(a1 * b1, a * b))


t = int(input())
i = 1
while i <= t:
	(a, b, x, y, n) = [int(x) for x in input().split()]
	l = a - x
	m = b - y
	v = 0
	w = 0
	n1 = n
	p = a - min(l, n)
	n = n - min(l, n)
	q = b - min(m, n)
	v = p * q
	q1 = b - min(m, n1)
	n1 = n1 - min(m, n1)
	p1 = a - min(l, n1)
	w = p1 * q1
	print(int(min(v, w)))
	i += 1


def solve(a, b, x, y, n):
	if x == 1 or y == 1:
		if x == 1 and a - x <= n:
			n -= a - x
			if n > 0:
				if n >= b - y:
					return x * y
				else:
					return 1 * (b - n)
			else:
				return 1 * b
		elif y == 1 and b - y <= n:
			n -= b - y
			if n > 0:
				if n >= a - x:
					return x * y
				else:
					return 1 * (a - n)
			else:
				return 1 * a
	return -1

def solve1(a, b, x, y, n):
	d = a - x
	if d >= n:
		return (a - n) * b
	elif n - d > b - y:
		return x * y
	else:
		return (a - d) * (b - (n - d))

def solve2(a, b, x, y, n):
	d = b - y
	if d >= n:
		return (b - n) * a
	elif n - d > a - x:
		return x * y
	else:
		return (b - d) * (a - (n - d))
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	s = solve(a, b, x, y, n)
	if s == -1:
		l = []
		l.append(solve1(a, b, x, y, n))
		l.append(solve2(a, b, x, y, n))
		print(min(l))
	else:
		print(s)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	s = min(n, a - x)
	t = min(n - s, b - y)
	p = min(n, b - y)
	q = min(n - p, a - x)
	print(min((a - s) * (b - t), (b - p) * (a - q)))


t = int(input())
import math
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	f = b - y
	b -= min(n, f)
	n -= min(n, f)
	f2 = a - x
	a -= min(f2, n)
	ans = a * b
	(a, b, x, y, n) = (a1, b1, x1, y1, n1)
	f = a - x
	a -= min(n, f)
	n -= min(n, f)
	f2 = b - y
	b -= min(f2, n)
	ans1 = a * b
	print(min(ans, ans1))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	difa = a - x
	difb = b - y
	(a1, a2, a3, a4, a5) = (float('inf'), float('inf'), float('inf'), float('inf'), float('inf'))
	if n >= difa + difb:
		a1 = x * y
	if n <= difa:
		a2 = (a - n) * b
	if n <= difb:
		a3 = (b - n) * a
	if difa <= n <= difb + difa:
		(na, nb, nn) = (a, b, n)
		na = x
		nn -= difa
		nb -= nn
		a4 = max(0, na * nb)
	if difb <= n <= difa + difb:
		(na, nb, nn) = (a, b, n)
		nb = y
		nn -= difb
		na -= nn
		a5 = max(0, na * nb)
	print(min(a * b, a1, a2, a3, a4, a5))


def greedy(a, b, x, y, n):
	a_moves = min(a - x, n)
	a -= a_moves
	n -= a_moves
	b_moves = min(b - y, n)
	b -= b_moves
	return a * b

def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = map(int, input().split())
		print(min(greedy(a, b, x, y, n), greedy(b, a, y, x, n)))
main()


import sys

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

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

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

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

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

def MOD():
	return 1000000007

def power(base, power):
	MOD = 1000000007
	result = 1
	while power > 0:
		if power % 2 == 1:
			result = result * base % MOD
		power = power // 2
		base = base * base % MOD
	return result
t = Int()
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = float('inf')
	if n >= a + b - x - y:
		ans = min(ans, x * y)
	if n >= a - x:
		ans = min(ans, x * max(y, b - n + (a - x)))
	if n >= b - y:
		ans = min(ans, max(x, a - n + (b - y)) * y)
	ans = min(ans, a * max(y, b - n))
	ans = min(ans, b * max(x, a - n))
	print(ans)


t = int(input())
while t > 0:
	(a, b, x, y, n) = map(int, input().split())
	d_a = (a - min(a - x, n)) * (b - min(b - y, n - min(a - x, n)))
	d_b = (b - min(b - y, n)) * (a - min(a - x, n - min(b - y, n)))
	print(min(d_a, d_b))
	t -= 1


t = int(input())
for i in range(t):
	(a, b, x, y, n) = input().split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	da1 = min(n, a - x)
	db1 = min(n - da1, b - y)
	ans1 = (a - da1) * (b - db1)
	db2 = min(n, b - y)
	da2 = min(n - db2, a - x)
	ans2 = (a - da2) * (b - db2)
	print(min(ans1, ans2))


T = int(input())
for t in range(T):
	(a, b, x, y, n) = [int(i) for i in input().split(' ')]
	newA = max(a - n, x)
	newB = max(b - n, y)
	if newB < newA:
		newA = max(x, a + min(0, b - y - n))
	else:
		newB = max(y, b + min(0, a - x - n))
	print(newA * newB)


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		if a - n < x:
			p = x
		else:
			p = a - n
		if b - n < y:
			q = y
		else:
			q = b - n
		m = min(p, q)
		if m == p:
			print(p * (b - (n - (a - p))))
		else:
			print(q * (a - (n - (b - q))))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a + b - x - y <= n:
		print(x * y)
	else:
		ans = 9999999999999999999999999999999999999
		if n > a - x:
			n1 = n - a + x
			y1 = b - n1
			ans = min(ans, x * y1)
		else:
			ans = min(ans, (a - n) * b)
		if n > b - y:
			n1 = n - b + y
			x1 = a - n1
			ans = min(ans, y * x1)
		else:
			ans = min(ans, (b - n) * a)
		print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(cpa, cpb, cpx, cpy, cpn) = (a, b, x, y, n)
	l = []
	if a - n < x:
		n -= abs(a - x)
		a = x
		b = max(b - n, y)
		l.append(a * b)
	else:
		a -= n
		n = 0
		l.append(a * b)
	(a, b, x, y, n) = (cpa, cpb, cpx, cpy, cpn)
	if b - n < y:
		n -= abs(b - y)
		b = y
		a = max(a - n, x)
		l.append(a * b)
	else:
		b -= n
		n = 0
		l.append(a * b)
	print(min(l))


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for j in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	temp1 = n
	tempa = a
	tempb = b
	diff = tempa - x
	v0 = min(diff, temp1)
	temp1 -= v0
	tempa -= v0
	diff2 = tempb - y
	v1 = min(diff2, temp1)
	temp1 -= v1
	tempb -= v1
	prod = tempa * tempb
	temp2 = n
	tempa2 = a
	tempb2 = b
	diff3 = tempb2 - y
	v2 = min(diff3, temp2)
	temp2 -= v2
	tempb2 -= v2
	diff4 = tempa2 - x
	v3 = min(diff4, temp2)
	temp2 -= v3
	tempa2 -= v3
	prod1 = tempa2 * tempb2
	print(min(prod1, prod))


def fun(a, b, x, y, n):
	if a - n < x:
		n -= a - x
		a = x
	elif a - n >= x:
		a -= n
		n = 0
	if b - n < y:
		n -= b - y
		b = y
	else:
		b -= n
		n = 0
	return a * b
t = int(input())
for hola in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(fun(a, b, x, y, n), fun(b, a, y, x, n)))


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = list(map(int, input().split()))
	a1 = max([0, x, a - n])
	r1 = n - (a - a1)
	b1 = max([0, y, b - r1])
	b2 = max([0, y, b - n])
	r2 = n - (b - b2)
	a2 = max([0, x, a - r2])
	ans = min(a1 * b1, a2 * b2)
	print(ans)


testes = int(input())
for _ in range(testes):
	(a, b, x, y, n) = map(int, input().split())
	da_a = max(a - n, x)
	if da_a == x:
		da_b = max(b - (n - (a - x)), y)
	else:
		da_b = b
	db_b = max(b - n, y)
	if db_b == y:
		db_a = max(a - (n - (b - y)), x)
	else:
		db_a = a
	res = min(da_a * da_b, db_a * db_b)
	print(res)


def solve():
	(a, b, x, y, n) = map(int, input().split())
	a_min = max(x, a - n)
	b_min = max(y, b - n)
	if a_min < b_min:
		n -= a - a_min
		_b = max(y, b - n)
		print(a_min * _b)
	else:
		n -= b - b_min
		_a = max(x, a - n)
		print(b_min * _a)
for i in range(int(input())):
	solve()


t = int(input())
for _ in range(t):
	hello = list(map(int, input().split()))
	a = hello[0]
	b = hello[1]
	x = hello[2]
	y = hello[3]
	n = hello[4]
	c = a
	d = b
	m = n
	if b - n < y:
		n -= b - y
		b = y
		if a - n < x:
			a = x
		else:
			a -= n
	else:
		b -= n
	if c - m < x:
		m -= c - x
		c = x
		if d - m < y:
			d = y
		else:
			d -= m
	else:
		c -= m
	if a * b > c * d:
		print(c * d)
	else:
		print(a * b)


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	u = [a, b]
	f = [a, b]
	s = n
	l = min(a - x, n)
	n -= l
	u[0] -= l
	u[1] -= min(b - y, n)
	l = min(b - y, s)
	s -= l
	f[1] -= l
	f[0] -= min(a - x, s)
	print(min(u[0] * u[1], f[0] * f[1]))


z = int(input())
d = []
for i in range(z):
	x = list(map(int, input().split()))
	a = x[0]
	b = x[1]
	c = x[4]
	ar = a - x[2]
	if ar >= c:
		ar = c
		a -= ar
	else:
		a -= ar
		c -= ar
		br = b - x[3]
		if br >= c:
			br = c
		b -= br
	result1 = a * b
	a1 = x[1]
	b1 = x[0]
	c1 = x[4]
	ar1 = a1 - x[3]
	if ar1 >= c1:
		ar1 = c1
		a1 -= ar1
	else:
		a1 -= ar1
		c1 -= ar1
		br1 = b1 - x[2]
		if br1 >= c1:
			br1 = c1
		b1 -= br1
	result2 = a1 * b1
	d.append(min(result1, result2))
for i in d:
	print(i)


for _ in range(int(input())):
	(x, y, a, b, n) = map(int, input().split())
	p = max(x - n, a)
	n1 = x - p
	ans1 = p * max(y - n + n1, b)
	q = max(y - n, b)
	n2 = y - q
	ans2 = q * max(x - n + n2, a)
	print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	t1 = a
	t2 = b
	t3 = n
	ans = 9999999999999999999
	if a - x >= n:
		ans = min((a - n) * b, ans)
	else:
		n = n + x - a
		if b - y >= n:
			ans = min(x * (b - n), ans)
		else:
			ans = min(x * y, ans)
	a = t1
	b = t2
	n = t3
	if b - y >= n:
		ans = min(a * (b - n), ans)
	else:
		n = n + y - b
		if a - x >= n:
			ans = min((a - n) * y, ans)
		else:
			ans = min(x * y, ans)
	print(ans)


import math
from collections import deque
import sys
sys.setrecursionlimit(10 ** 4)

def Divisors(n):
	l = []
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):
	l = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			l.append(p)
	return l

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

def Factors(n):
	result = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if i == n / i:
				result.append(i)
			else:
				result.append(i)
				result.append(n // i)
	result.append(1)
	return result

def maxSubArraySum(a):
	max_so_far = 0
	max_ending_here = 0
	size = len(a)
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < abs(max_ending_here):
			max_so_far = max_ending_here
	return max_so_far

def longestsubarray(arr, n, k):
	current_count = 0
	max_count = 0
	for i in range(0, n, 1):
		if arr[i] % k != 0:
			current_count += 1
		else:
			current_count = 0
		max_count = max(current_count, max_count)
	return max_count

def main():
	(a, b, x, y, n) = list(map(int, input().split()))
	c1 = 0
	c2 = 0
	n1 = n
	if y > x:
		c = a
		a = b
		b = c
		c = x
		x = y
		y = c
	p1 = max(b - n, y)
	n -= b - p1
	p2 = max(a - n, x)
	c1 = p1 * p2
	if b > a:
		c = a
		a = b
		b = c
		c = x
		x = y
		y = c
	p1 = max(b - n1, y)
	n1 -= b - p1
	p2 = max(a - n1, x)
	c2 = p1 * p2
	print(min(c1, c2))
t = int(input())
for i in range(0, t):
	main()


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	couldDoB = b - min(b - y, n)
	couldDoA = a - min(a - x, n)
	if couldDoA < couldDoB:
		more = n - (a - couldDoA)
		b = max(b - more, y)
		print(couldDoA * b)
	else:
		more = n - (b - couldDoB)
		a = max(a - more, x)
		print(couldDoB * a)


t = int(input())
for test in range(t):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	(a1, b1, n1) = (a, b, n)
	if a1 - x < n1:
		n1 -= a1 - x
		a1 = x
		if b1 - y < n1:
			b1 = y
		else:
			b1 = b1 - n1
	else:
		a1 = a1 - n1
	ans1 = a1 * b1
	if b - y < n:
		n -= b - y
		b = y
		if a - x < n:
			a = x
		else:
			a = a - n
	else:
		b = b - n
	ans2 = a * b
	print(min(ans1, ans2))


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	s = 999999999999999999999
	if a - x + b - y <= n:
		print(x * y)
	else:
		for i in range(2):
			c = min(a - x, n)
			aa = a - c
			nn = n - c
			bb = b - min(b - y, nn)
			s = min(s, aa * bb)
			(a, b) = (b, a)
			(x, y) = (y, x)
		print(s)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a < b:
		(mi, ri, ma, ra, ni, na) = (a, x, b, y, a - x, b - y)
	else:
		(mi, ri, ma, ra, ni, na) = (b, y, a, x, b - y, a - x)
	if n >= ni + na:
		print(ri * ra)
	else:
		rc = []
		ans = []
		if ni >= n:
			rc.append(ma * n)
		else:
			dmi = ri
			dma = ma - (n - ni)
			ans.append(dmi * dma)
		if na >= n:
			rc.append(mi * n)
		else:
			dma = ra
			dmi = mi - (n - na)
			ans.append(dmi * dma)
		if rc:
			ans.append(mi * ma - max(rc))
		print(min(ans))


t = int(input())
while t > 0:
	t -= 1
	line = input().split(' ')
	a = int(line[0])
	b = int(line[1])
	x = int(line[2])
	y = int(line[3])
	n = int(line[4])
	tmpa = a
	tmpb = b
	tmpx = x
	tmpy = y
	tmpn = n
	ad = min(a - x, n)
	a -= ad
	n -= ad
	b -= min(b - y, n)
	p1 = a * b
	a = tmpb
	b = tmpa
	x = tmpy
	y = tmpx
	n = tmpn
	ad = min(a - x, n)
	a -= ad
	n -= ad
	b -= min(b - y, n)
	p2 = a * b
	print(min(p1, p2))


t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	a1 = a - min(a - x, n)
	n1 = n - (a - a1)
	b1 = b - min(b - y, n1)
	b2 = b - min(b - y, n)
	n2 = n - (b - b2)
	a2 = a - min(a - x, n2)
	print(min(a1 * b1, a2 * b2))


import sys
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split())
	arr = [[a, x], [b, y]]
	small = []
	large = []
	if arr[0][0] > arr[1][0]:
		small = arr[1]
		large = arr[0]
	else:
		small = arr[0]
		large = arr[1]
	ans = float('inf')
	if small[0] - small[1] >= n:
		ans = min(ans, (small[0] - n) * large[0])
	elif n - (small[0] - small[1]) >= large[0] - large[1]:
		ans = min(ans, small[1] * large[1])
	else:
		ans = min(ans, small[1] * (large[0] - (n - (small[0] - small[1]))))
	if large[0] - large[1] >= n:
		ans = min(ans, (large[0] - n) * small[0])
	elif n - (large[0] - large[1]) >= small[0] - small[1]:
		ans = min(ans, small[1] * large[1])
	else:
		ans = min(ans, large[1] * (small[0] - (n - (large[0] - large[1]))))
	print(ans)


for i in range(int(input())):
	(a, b, x, y, n) = (int(j) for j in input().split())
	ans = 10 ** 18
	d1 = a - x
	d2 = b - y
	if d1 > n:
		ans = min(ans, (a - n) * b)
	elif d1 + d2 > n:
		ans = min(ans, x * (b - n + d1))
	else:
		ans = min(ans, x * y)
	(x, y) = (y, x)
	(a, b) = (b, a)
	d1 = a - x
	d2 = b - y
	if d1 > n:
		ans = min(ans, (a - n) * b)
	elif d1 + d2 > n:
		ans = min(ans, x * (b - n + d1))
	else:
		ans = min(ans, x * y)
	print(ans)


import sys
input = sys.stdin.readline
from collections import defaultdict
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	nn = n
	aa = a - n
	if aa < x:
		n -= a - x
		aa = x
	else:
		n = 0
	bb = b - n
	if bb < y:
		n -= b - y
		bb = y
	else:
		n = 0
	c = aa * bb
	n = nn
	bb = b - n
	if bb < y:
		n -= b - y
		bb = y
	else:
		n = 0
	aa = a - n
	if aa < x:
		n -= a - x
		aa = x
	else:
		n = 0
	d = aa * bb
	print(min(c, d))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	A = a
	B = b
	if a - min(a - x, n) > b - min(b - y, n):
		b -= min(b - y, n)
		n -= min(B - y, n)
		a -= min(a - x, n)
		print(a * b)
	else:
		a -= min(a - x, n)
		n -= min(A - x, n)
		b -= min(b - y, n)
		print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	add = a + b - n
	add1 = x + y
	if add < add1:
		print(x * y)
	else:
		c = max(x, a - n)
		d = max(y, b - n)
		one = c * (a + b - c - n)
		two = d * (a + b - d - n)
		print(min(one, two))


def operation(data):
	(a, b, x, y, n) = data
	if b - y >= n:
		b -= n
	else:
		n -= b - y
		b = y
		if a - x >= n:
			a -= n
		else:
			a = x
	return a * b
t = int(input())
resultList = []
for i in range(0, t):
	data = list(map(int, input().split()))
	result1 = operation(data)
	(data[0], data[1], data[2], data[3]) = (data[1], data[0], data[3], data[2])
	result2 = operation(data)
	resultList.append(min(result1, result2))
for i in resultList:
	print(i)


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

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

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

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

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

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

def val(a, b, x, y):
	na = max(a - n, x)
	d = a - na
	nb = max(b - (n - d), y)
	return na * nb
for _ in range(II()):
	(a, b, x, y, n) = MI()
	print(min(val(a, b, x, y), val(b, a, y, x)))


import math
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().strip().split(' '))
	if n >= a - x + (b - y):
		print(x * y)
	else:
		if a - x <= n:
			t1 = x * (b - (n - (a - x)))
		else:
			t1 = (a - n) * b
		if b - y <= n:
			t2 = y * (a - (n - (b - y)))
		else:
			t2 = (b - n) * a
		print(min(t1, t2))


k = int(input())
for i in range(k):
	s = input()
	(a, b, x, y, n) = map(int, s.split())
	ra = a - x
	rb = b - y
	vn = min(n, ra)
	a -= vn
	n -= vn
	if n > 0:
		vn = min(n, rb)
		b -= vn
		n -= vn
	r1 = a * b
	(a, b, x, y, n) = map(int, s.split())
	ra = a - x
	rb = b - y
	vn = min(n, rb)
	b -= vn
	n -= vn
	if n > 0:
		vn = min(n, ra)
		a -= vn
		n -= vn
	r2 = a * b
	print(r1 if r1 < r2 else r2)


l = int(input())
for _ in range(l):
	(a, b, x, y, n) = [int(i) for i in input().split(' ')]
	new_a = max(x, a - n)
	new_b = max(y, b - (n - (a - new_a)))
	p1 = new_a * new_b
	new_b = max(y, b - n)
	new_a = max(x, a - (n - (b - new_b)))
	p2 = new_a * new_b
	print(min(p1, p2))


def sub(n, a, x):
	da = min(n, a - x)
	return (a - da, n - da)

def opt_mul(a, b, x, y, n):
	(b, n) = sub(n, b, y)
	(a, _) = sub(n, a, x)
	return a * b

def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = map(int, input().split())
		print(min(opt_mul(a, b, x, y, n), opt_mul(b, a, y, x, n)))
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(d, c) = (a - x, b - y)
	(ans1, ans2) = (0, 0)
	if n >= d + c:
		print(x * y)
		continue
	if d <= n:
		n1 = n - d
		ans1 = x
		ans1 *= b - n1
	else:
		ans1 = b * (a - n)
	if c <= n:
		n2 = n - c
		ans2 = y
		ans2 *= a - n2
	else:
		ans2 = a * (b - n)
	print(min(ans1, ans2))


tc = int(input())
import math

def m1(a, b, x, y, n):
	diff = min(a - x, n)
	extra = n - diff
	a -= diff
	b -= min(b - y, extra)
	return a * b

def m2(a, b, x, y, n):
	diff = min(b - y, n)
	extra = n - diff
	b -= diff
	a -= min(a - x, extra)
	return a * b
for _ in range(tc):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	print(min(m1(a, b, x, y, n), m2(a, b, x, y, n)))


def p1(a, b, x, y, n):
	d = min(a - x, n)
	a -= d
	n -= d
	d = min(b - y, n)
	b -= d
	return a * b

def p2(a, b, x, y, n):
	d = min(b - y, n)
	b -= d
	n -= d
	d = min(a - x, n)
	a -= d
	return a * b
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(p1(a, b, x, y, n), p2(a, b, x, y, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	aa = a - x
	bb = b - y
	p1 = float('inf')
	p2 = float('inf')
	p3 = float('inf')
	p4 = float('inf')
	if aa + bb <= n:
		print(x * y)
	else:
		if aa <= n:
			tt = n - aa
			k = b - tt
			p1 = x * k
			if b - n < y:
				c = y
				kk = n - (b - y)
				kk = a - kk
			else:
				c = b - n
				kk = a
			p3 = c * kk
		if bb <= n:
			tt = n - bb
			k = a - tt
			p2 = y * k
			if a - n < x:
				c = x
				kk = n - (a - x)
				kk = b - kk
			else:
				c = a - n
				kk = b
			p4 = c * kk
		if aa > n and bb > n:
			c = b - n
			p1 = c * a
			p2 = (a - n) * b
		print(min(p1, p2, p3, p4))


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


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


for i in range(int(input())):
	(a, b, x, y, n) = [int(a) for a in input().split()]
	c = max(a - n, x)
	d = max(b - n, y)
	if c <= d:
		if a - x < n:
			n = n - (a - x)
			b = max(b - n, y)
			print(c * b)
		else:
			print(b * c)
	elif b - y < n:
		n = n - (b - y)
		a = max(a - n, x)
		print(a * d)
	else:
		print(a * d)


import sys, os
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
input = lambda : sys.stdin.readline().strip()
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
for _ in range(I()):
	(a, b, x, y, n) = li()
	cn = n
	(ma, mb) = (a, b)
	if a > x:
		ma = max(x, a - n)
		n -= a - ma
	if n > 0:
		if b > y:
			mb = max(y, b - n)
	n = cn
	(na, nb) = (a, b)
	if b > y:
		nb = max(y, b - n)
		n -= b - nb
	if n > 0:
		if a > x:
			na = max(x, a - n)
	print(min(ma * mb, na * nb))


import sys
IN = sys.stdin.readline
out = []
for _ in range(int(IN())):
	(a, b, x, y, n) = map(int, IN().split())
	if a - min(a - x, n) < b - min(b - y, n):
		(a, b) = (b, a)
		(x, y) = (y, x)
	d = min(b - y, n)
	b -= d
	n -= d
	a -= min(a - x, n)
	out.append(str(a * b))
print('\n'.join(out))


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil, pi, sin, cos, acos, atan
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	(a, b, x, y, n) = inp()
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if True:
		diff = abs(a - x)
		if diff >= n:
			a -= n
			n = 0
		else:
			n -= diff
			a = x
		if n > 0:
			diff = abs(b - y)
			if diff >= n:
				b -= n
				n = 0
			else:
				n -= diff
				b = y
		ans1 = a * b
	(a, b, x, y, n) = (a1, b1, x1, y1, n1)
	if True:
		diff = abs(b - y)
		if diff >= n:
			b -= n
			n = 0
		else:
			n -= diff
			b = y
		if n > 0:
			diff = abs(a - x)
			if diff >= n:
				a -= n
				n = 0
			else:
				n -= diff
				a = x
		ans2 = a * b
	ans = min(ans1, ans2)
	out(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = [int(p) for p in input().split()]
	a1 = a
	b1 = b
	n1 = n
	temp = min(n, abs(x - a))
	a = a - min(n, abs(x - a))
	n -= temp
	b = b - min(n, abs(y - b))
	p1 = a * b
	a = a1
	b = b1
	n = n1
	temp = min(n, abs(y - b))
	b = b - min(n, abs(y - b))
	n -= temp
	a = a - min(n, abs(x - a))
	p2 = a * b
	print(min(p1, p2))


t = int(input())
for i in range(t):
	abxyn = input()
	(a, b, x, y, n) = abxyn.split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	ans = -1
	aa = a - n if a - n >= x else x
	nn = 0 if a - n >= x else n - a + x
	bb = b - nn if b - nn >= y else y
	ans = aa * bb if aa * bb < ans else ans
	if ans == -1:
		ans = aa * bb
	bb = b - n if b - n >= y else y
	nn = 0 if b - n >= y else n - b + y
	aa = a - nn if a - nn >= x else x
	ans = aa * bb if aa * bb < ans else ans
	if ans == -1:
		ans = aa * bbs
	print(ans)


import math

def solve(a, b, x, y, n):
	aSub = min(n, a - x)
	n = n - aSub
	a = a - aSub
	b = max(y, b - n)
	return a * b
t = int(input())
while t > 0:
	k = input()
	a = int(k.split(' ')[0])
	b = int(k.split(' ')[1])
	x = int(k.split(' ')[2])
	y = int(k.split(' ')[3])
	n = int(k.split(' ')[4])
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))
	t = t - 1


t = int(input())
for i in range(t):
	(a, b, x, y, n) = input().split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	doublea = a - n
	if doublea < x:
		doublea = x
	doubleb = b - (n - (a - doublea))
	if doubleb < y:
		doubleb = y
	ans = doublea * doubleb
	doubleb = b - n
	if doubleb < y:
		doubleb = y
	doublea = a - (n - (b - doubleb))
	if doublea < x:
		doublea = x
	if ans > doublea * doubleb:
		ans = doublea * doubleb
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	tmp_n = n
	arr_a = []
	arr_b = []
	tmp = a - min(a - x, n)
	arr_a.append(tmp)
	if min(a - x, n) != n:
		tmp_n -= a - x
		tmp = b - min(b - y, tmp_n)
		arr_b.append(tmp)
	else:
		arr_b.append(b)
	tmp = b - min(b - y, n)
	arr_b.append(tmp)
	if min(b - y, n) != n:
		n -= b - y
		tmp = a - min(a - x, n)
		arr_a.append(tmp)
	else:
		arr_a.append(a)
	print(min(arr_a[0] * arr_b[0], arr_a[1] * arr_b[1]))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = [int(j) for j in input().split()]
	a2 = a
	b2 = b
	n2 = n
	if a - x <= n:
		n -= a - x
		a -= a - x
		if n > 0:
			if b - y <= n:
				n -= b - y
				b -= b - y
			else:
				b -= n
				n = 0
	else:
		a -= n
		n = 0
	if b2 - y <= n2:
		n2 -= b2 - y
		b2 -= b2 - y
		if n2 > 0:
			if a2 - x <= n2:
				n2 -= a2 - x
				a2 -= a2 - x
			else:
				a2 -= n2
				n2 = 0
	else:
		b2 -= n2
		n2 = 0
	if a * b < a2 * b2:
		print(a * b)
	else:
		print(a2 * b2)


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	amount = min(b - y, n)
	b -= amount
	n -= amount
	if n > 0:
		a -= min(a - x, n)
	ans1 = a * b
	amount = min(a1 - x1, n1)
	a1 -= amount
	n1 -= amount
	if n1 > 0:
		b1 -= min(b1 - y1, n1)
	ans2 = a1 * b1
	print(min(ans1, ans2))


from sys import stdin
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if (a - min(a - x, n)) * (b - min(b - y, n - min(a - x, n))) < (b - min(b - y, n)) * (a - min(a - x, n - min(b - y, n))):
		print((a - min(a - x, n)) * (b - min(b - y, n - min(a - x, n))))
	else:
		print((b - min(b - y, n)) * (a - min(a - x, n - min(b - y, n))))


import math, sys, itertools

def sub(a, b, x, y, n):
	if a - n < x:
		n -= a - x
		a = x
	else:
		a -= n
		n = 0
	if b - n < y:
		b = y
	else:
		b -= n
	return a * b

def solve(a, b, y, x, n):
	low = 10 ** 20
	t = sub(a, b, x, y, n)
	low = t
	t = sub(b, a, y, x, n)
	low = min(low, t)
	return low
for _ in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	print(solve(a, b, y, x, n))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(m1, m2) = (a, b)
	m3 = max(m2 - n, y)
	m1 = max(m1 - n + m2 - m3, x)
	a1 = m1 * m3
	(m1, m2) = (b, a)
	m3 = max(m2 - n, x)
	m1 = max(m1 - n + m2 - m3, y)
	a2 = m1 * m3
	print(min(a1, a2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a2, b2, x2, y2, n2) = (b, a, y, x, n)
	ans1 = a * b
	minus = min(n, b - y)
	ans1 -= minus * a
	n -= minus
	b -= minus
	minus = min(n, a - x)
	ans1 -= minus * b
	n -= minus
	a -= minus
	ans2 = a2 * b2
	minus = min(n2, b2 - y2)
	ans2 -= minus * a2
	n2 -= minus
	b2 -= minus
	minus = min(n2, a2 - x2)
	ans2 -= minus * b2
	n2 -= minus
	a2 -= minus
	print(min(ans1, ans2))


from math import *

def calc(a, b, x, y, n):
	nn = n - min(n, a - x)
	a -= min(n, a - x)
	nnn = nn - min(nn, b - y)
	b -= min(nn, b - y)
	return a * b
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(calc(a, b, x, y, n), calc(b, a, y, x, n)))


def calc(a, b, x, y, n):
	if a - x >= n:
		ansa = (a - n) * b
	else:
		diff = n - (a - x)
		if b - y >= diff:
			ansa = x * (b - diff)
		else:
			ansa = x * y
	return ansa
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(calc(a, b, x, y, n), calc(b, a, y, x, n)))


import sys
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	da = min(n, a - x)
	db = min(n - da, b - y)
	ans1 = (a - da) * (b - db)
	db = min(n, b - y)
	da = min(n - db, a - x)
	ans2 = (a - da) * (b - db)
	print(min(ans1, ans2))


def ok(a, b, x, y, n):
	d1 = a - x
	c1 = min(d1, n)
	a -= c1
	n -= c1
	d2 = b - y
	c2 = min(d2, n)
	b -= c2
	n - c2
	return a * b
k = int(input())
for i in range(k):
	(a, b, x, y, n) = list(map(int, input().split(' ')))
	print(min(ok(a, b, x, y, n), ok(b, a, y, x, n)))


import sys
from math import sqrt
from collections import defaultdict
inpt = sys.stdin.readline

def inp():
	return int(inpt())

def inlist():
	return list(map(int, inpt().split()))

def instr():
	s = inpt()
	return list(s[:len(s) - 1])

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

class Graph:

	def __init__(self, n):
		self.n = n
		self.graph = defaultdict(list)
		self.marked = defaultdict(int)

	def addEdge(self, u, v):
		self.graph[u].append(v)
		self.graph[v].append(u)

	def dfs(self, u):
		self.marked[u] = 1
		for i in self.graph[u]:
			if self.marked[i] == 0:
				self.dfs(i)

def main():
	t = inp()
	for l in range(t):
		(a, b, x, y, n) = invr()
		minb1 = max(y, b - n)
		if minb1 == b - n:
			mina1 = a
		else:
			mina1 = max(x, a - (n - (b - y)))
		mina2 = max(x, a - n)
		if mina2 == a - n:
			minb2 = b
		else:
			minb2 = max(y, b - (n - (a - x)))
		ans = min(mina1 * minb1, mina2 * minb2)
		print(ans)
main()


test_cases = input()
for _ in range(int(test_cases)):
	(a, b, x, y, n) = map(int, input().split())
	max_a_steps = a - x
	max_b_steps = b - y
	if max_a_steps > n:
		max_a_steps = n
	if max_b_steps > n:
		max_b_steps = n
	decreased_a = a - max_a_steps
	decreased_b = b - max_b_steps
	if decreased_a < decreased_b:
		n -= max_a_steps
		a = decreased_a
		if n == 0:
			print(a * b)
			continue
		if max_b_steps > n:
			max_b_steps = n
		decreased_b = b - max_b_steps
		b = decreased_b
		print(a * b)
	else:
		n -= max_b_steps
		b = decreased_b
		if n == 0:
			print(a * b)
			continue
		if max_a_steps > n:
			max_a_steps = n
		decreased_a = a - max_a_steps
		a = decreased_a
		print(a * b)


def compute_mult(a, b, x, y, n):
	if a - n >= x:
		return (a - n) * b
	else:
		n -= a - x
		a = x
		if b - n >= y:
			return a * (b - n)
		else:
			return a * y

def main():
	n = int(input())
	for i in range(n):
		(a, b, x, y, n) = [int(x) for x in input().split()]
		print(min(compute_mult(a, b, x, y, n), compute_mult(b, a, y, x, n)))
main()


def oops1():
	print(x * y)

def oops2():
	if b - y >= n:
		print(a * (b - n))
	else:
		ss1 = (a - (n - b + y)) * y
		if a - x >= n:
			ss2 = (a - n) * b
		else:
			z = x + n - a
			ss2 = x * (b - z)
		print(min(ss1, ss2))

def oops3():
	if a - x >= n:
		print(b * (a - n))
	else:
		qq1 = (b - (n - a + x)) * x
		if b - y >= n:
			qq2 = (b - n) * a
		else:
			z = y + n - b
			qq2 = y * (a - z)
		print(min(qq1, qq2))
t = int(input())
for q in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if n >= a - x + b - y:
		oops1()
	elif a >= b:
		oops2()
	else:
		oops3()


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	min_a = a - min(a - x, n)
	min_b = b - min(b - y, n)
	if min_a < min_b:
		n -= min(a - x, n)
		b -= min(b - y, n)
		print(min_a * b)
	else:
		n -= min(b - y, n)
		a -= min(a - x, n)
		print(min_b * a)


import sys
read = sys.stdin.read
readlines = sys.stdin.readlines

def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = map(int, input().split())
		mina = max(x, a - n)
		minb = max(y, b - n)
		if mina <= minb:
			a2 = max(x, a - n)
			n -= a - a2
			if n > 0:
				b = max(y, b - n)
			print(a2 * b)
		else:
			b2 = max(y, b - n)
			n -= b - b2
			if n > 0:
				a = max(x, a - n)
			print(a * b2)
main()


tests = int(input())
for i in range(tests):
	(a, b, x, y, n) = map(int, input().split())
	ind_a = max(x, a - n)
	ind_b = max(y, b - n)
	if ind_b > ind_a:
		the_b = b - (n - (a - ind_a))
		real_b = max(the_b, y)
		minimum = real_b * ind_a
		print(minimum)
	else:
		the_a = a - (n - (b - ind_b))
		real_a = max(the_a, x)
		minimum = real_a * ind_b
		print(minimum)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a2 = max(a - n, x)
	b2 = max(b - n, y)
	if a2 <= b2:
		n = n - (a - a2)
		b = max(b - n, y)
		print(a2 * b)
	else:
		n = n - (b - b2)
		a = max(a - n, x)
		print(b2 * a)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	l = max(0, n - a + x)
	l2 = max(0, l - b + y)
	op1 = (a - n + l) * (b - l + l2)
	l = max(0, n - b + y)
	l2 = max(0, l - a + x)
	op2 = (b - n + l) * (a - l + l2)
	print(min(op1, op2))


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

def int1():
	return int(input())

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

def list1():
	return list(map(int, input().split()))
mod = pow(10, 9) + 7

def solve():
	(a, b, x, y, n) = map1()
	a1 = a
	b1 = b
	c1 = a - x
	c2 = b - y
	v = a + b - x - y
	n = min(n, v)
	n1 = n
	if 1:
		if c1 > n:
			k1 = (a - n) * b
		else:
			a1 = a1 - c1
			n1 = n1 - c1
			b1 = b1 - n1
			k1 = a1 * b1
	if 1:
		if c2 > n:
			k2 = (b - n) * a
		else:
			b = b - c2
			n = n - c2
			a = a - n
			k2 = a * b
	print(min(k1, k2))
for _ in range(int(input())):
	solve()


from sys import stdin, stdout
from math import ceil, floor, factorial, gcd, log, pi
from collections import deque, defaultdict, OrderedDict, Counter
import random
import itertools
from heapq import heapify, heappush, heappop
integerMaxValue = float('inf')
integerMinValue = float('-inf')
MOD = 10 ** 9 + 7

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

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

def readString():
	return stdin.readline()

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

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

def readStrArray():
	return list(map(str, stdin.readline().strip().split()))

def constructMinHeap(nums, n):
	minHeap = []
	for num in nums:
		heappush(minHeap, num)
	return minHeap

def constructMaxHeap(nums, n):
	maxHeap = []
	for num in nums:
		heappush(maxHeap, -num)
	return maxHeap

def solve(a, b, x, y, n):
	temp = a - x + (b - y)
	if temp <= n:
		return x * y
	k = min(a - x, n)
	ans1 = (a - k) * (b - n + k)
	k = min(b - y, n)
	ans2 = (a - n + k) * (b - k)
	ans1 = min(ans1, ans2)
	return ans1
testCases = readInt()
for case in range(testCases):
	(a, b, x, y, n) = readInts()
	print(solve(a, b, x, y, n))


t = int(input())

def solve(a, b, x, y, n):
	aSub = min(n, a - x)
	n -= aSub
	a -= aSub
	b = max(y, b - n)
	return a * b
while t:
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))
	t -= 1


def minProd(high, low, x, y, n):
	k = min(high - x, n)
	high -= k
	n -= k
	k = min(low - y, n)
	low -= k
	n -= k
	return high * low
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(minProd(a, b, x, y, n), minProd(b, a, y, x, n)))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	i = max(min(a - x, y + n - b), 0)
	j = min(max(a - x, y + n - b), n)
	print(max(min((a - i) * (b + i - n), (a - j) * (b + j - n)), x * y))


x = int(input())
test_cases = []
for i in range(x):
	a = [int(x) for x in input().split()]
	test_cases.append(a)
for t in test_cases:
	if t[0] == t[2] and t[1] == t[3]:
		print(t[0] * t[1])
	else:
		a = t[0]
		b = t[1]
		x = t[2]
		y = t[3]
		n = t[4]
		products = []
		if n > a - x + (b - y):
			print(x * y)
		else:
			if n == 0:
				print(a * b)
			if a - n >= x:
				products.append((a - n) * b)
			if b - n >= y:
				products.append((b - n) * a)
			if a - n < x:
				p = x * (b - (x - a + n))
				products.append(p)
			if b - n < y:
				p = y * (a - (y - b + n))
				products.append(p)
			print(min(products))


from math import ceil
from collections import deque
for _ in range(int(input())):
	(a1, b1, x, y, n1) = [int(i) for i in input().split()]
	n2 = n1
	a2 = a1
	b2 = b1
	t = min(a1 - x, n1)
	a1 -= t
	n1 -= t
	t = min(b1 - y, n1)
	b1 -= t
	n1 -= t
	ans = a1 * b1
	t = min(b2 - y, n2)
	b2 -= t
	n2 -= t
	t = min(a2 - x, n2)
	a2 -= t
	n2 -= t
	ans = min(ans, a2 * b2)
	print(ans)


t = int(input())
w = []
for i in range(t):
	(a, b, x, y, n) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	r = a - x
	s = b - y
	if r >= n:
		k = (a - n) * b
	else:
		k = x * max(b - n + r, y)
	if s >= n:
		m = (b - n) * a
	else:
		m = y * max(a - n + s, x)
	w.append(min(k, m))
for i in w:
	print(i)


import sys
input = sys.stdin.readline

def go(a, b, x, y, n):
	can = min(a - x, n)
	a -= can
	n -= can
	can = min(b - y, n)
	b -= can
	return a * b

def solve():
	(a, b, x, y, n) = map(int, input()[:-1].split())
	op1 = go(a, b, x, y, n)
	op2 = go(b, a, y, x, n)
	print(min(op1, op2))

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


t = int(input())
for i in range(t):
	(a, b, x, y, n) = [int(j) for j in input().split()]
	if a - min(a - x, n) > b - min(b - y, n):
		zv = n - min(b - y, n)
		if zv == 0:
			print(a * (b - min(b - y, n)))
		elif zv > 0:
			print((a - min(a - x, zv)) * (b - min(b - y, n)))
	else:
		zv = n - min(a - x, n)
		if zv == 0:
			print((a - min(a - x, n)) * b)
		elif zv > 0:
			print((a - min(a - x, n)) * (b - min(b - y, zv)))


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

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

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

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

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

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

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

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

def S():
	return input()

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

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

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

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

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

def main():
	t = I()
	rr = []
	for _ in range(t):
		(a, b, x, y, n) = LI()
		c = max(a - n, x)
		d = max(b - n, y)
		if c < d:
			n -= a - c
			a = c
			b -= min(b - y, n)
		else:
			n -= b - d
			b = d
			a -= min(a - x, n)
		rr.append(a * b)
	return JA(rr, '\n')
print(main())


def func(a, b, x, y, n):
	op = min(a - x, n)
	a -= op
	n -= op
	op = min(b - y, n)
	b -= op
	return a * b
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(func(a, b, x, y, n), func(b, a, y, x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(d1, d2) = (a - x, b - y)
	if n >= d1 + d2:
		print(x * y)
		continue
	a1 = max(x, a - n)
	n1 = n - (a - a1)
	b1 = max(y, b - n1)
	b2 = max(y, b - n)
	n2 = n - (b - b2)
	a2 = max(x, a - n2)
	print(min(a1 * b1, a2 * b2))


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(a, b, x, y, n) = map(int, input().split())
	min_a = a - min(a - x, n)
	min_b = b - min(b - y, n)
	if min_a < min_b:
		new_a = min_a
		if min_a == x:
			new_b = b - min(n - (a - x), b - y)
		else:
			new_b = b
	else:
		new_b = min_b
		if min_b == y:
			new_a = a - min(n - (b - y), a - x)
		else:
			new_a = a
	print(new_a * new_b)


import sys
import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if max(a - n, x) > max(b - n, y):
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a - x < n:
		n -= a - x
		a = x
	else:
		a = a - n
		n = 0
	if b - y < n:
		n -= b - y
		b = y
	else:
		b = b - n
	print(a * b)


def find(a, b, x, y):
	if a <= b:
		return (a, b, x, y)
	else:
		return (b, a, y, x)

def func(a, b, x, y, n):
	if a - x + (b - y) <= n:
		print(x * y)
		return
	(small, big, x, y) = find(a, b, x, y)
	stodec = small - x
	btodec = big - y
	if small == big:
		if stodec < btodec:
			temp = stodec
			stodec = btodec
			btodec = temp
	if stodec >= n:
		print(big * (small - n))
		return
	first = (small - stodec) * (big - (n - stodec))
	second = float('inf')
	if btodec < n:
		second = (big - btodec) * (small - (n - btodec))
	elif btodec >= n:
		second = (big - n) * small
	if first <= second:
		print(first)
		return
	print(second)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	func(a, b, x, y, n)


t = int(input())
for c in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = ans2 = 0
	if n >= a - x:
		ans1 = x * (b - min(b - y, n - a + x))
	else:
		ans1 = (a - n) * b
	if n >= b - y:
		ans2 = y * (a - min(a - x, n - b + y))
	else:
		ans2 = (b - n) * a
	print(min(ans1, ans2))


from sys import *
input = lambda : stdin.readline()
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
for _ in range(int(input())):
	(a, b, x, y, n) = get_int()
	frst = min(n, a - x)
	scnd = min(n - frst, b - y)
	third = min(n, b - y)
	fourth = min(n - third, a - x)
	print(min((a - frst) * (b - scnd), (b - third) * (a - fourth)))


for _ in range(int(input())):
	(u, v, x, y, w) = map(int, input().split())
	a = u
	b = v
	n = w
	if a - n < x:
		a = x
	elif a - n >= x:
		a -= n
	if b - n < y:
		b = y
	elif b - n >= y:
		b -= n
	if a < b:
		n -= u - x
		if n > 0:
			if v - n < y:
				v = y
			elif v - n >= y:
				v -= n
		print(v * a)
	elif a >= b:
		n -= v - y
		if n > 0:
			if u - n < x:
				u = x
			elif u - n >= x:
				u -= n
		print(b * u)


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(a1, b1, n1) = (a, b, n)
	(a2, b2, n2) = (a, b, n)
	diff = a - x
	diff = min(diff, n)
	a = a - diff
	n -= diff
	diff = b - y
	diff = min(diff, n)
	b -= diff
	n -= diff
	now = a * b
	diff = b1 - y
	diff = min(diff, n1)
	b1 -= diff
	n1 -= diff
	diff = a1 - x
	diff = min(diff, n1)
	a1 = a1 - diff
	n1 -= diff
	if a == b:
		diff = a2 - x
		diff = min(diff, n2 // 2)
		a2 = a2 - diff
		n2 -= diff
		diff = b2 - y
		diff = min(diff, n2)
		b2 -= diff
		n2 -= diff
		diff = a2 - x
		diff = min(diff, n2 // 2)
		a2 = a2 - diff
		n2 -= diff
		now = min(now, a2 * b2)
	now = min(now, a1 * b1)
	print(now)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	elif a == b:
		X = min(x, y)
		Y = max(x, y)
		x = X
		y = Y
	if not (x > y and b - n <= x):
		if n <= a - x:
			print((a - n) * b)
		else:
			val = min(b - y, n - a + x)
			b -= val
			print(x * b)
	else:
		val = min(n, b - y)
		b -= val
		n -= val
		if n > 0:
			val = min(n, a - x)
			a -= val
			n -= val
		print(a * b)


import math
t = int(input())

def cal(a, b, x, y, n):
	curr = a - x
	a -= min(n, curr)
	n -= min(n, curr)
	curr = b - y
	b -= min(n, curr)
	return a * b
for q in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = cal(a, b, x, y, n)
	ans2 = cal(b, a, y, x, n)
	print(min(ans1, ans2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	mina1 = max(x, a - n)
	minb1 = max(y, b - (n - a + mina1))
	minb2 = max(y, b - n)
	mina2 = max(x, a - (n - b + minb2))
	print(min(mina1 * minb1, mina2 * minb2))


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
		(a1, b1) = (b1, a1)
		(x1, y1) = (y1, x1)
	d1 = a - x
	mn = min(n, d1)
	a -= mn
	n -= mn
	mn = min(n, b - y)
	b -= mn
	ans1 = a * b
	d1 = b1 - y1
	mn = min(n1, d1)
	b1 -= mn
	n1 -= mn
	mn = min(n1, a1 - x1)
	a1 -= mn
	ans2 = a1 * b1
	print(min(ans1, ans2))


def solve(a, b, x, y, n):
	ans = float('inf')
	for i in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b, x, y) = (b, a, y, x)
	return ans
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(solve(a, b, x, y, n))


import sys
import math
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	val1 = a
	val2 = b
	m = n
	d = min(a - x, n)
	a -= d
	n -= d
	d = min(b - y, n)
	b -= d
	n -= d
	prod1 = a * b
	d = min(val2 - y, m)
	val2 -= d
	m -= d
	d = min(val1 - x, m)
	val1 -= d
	m -= d
	prod2 = val1 * val2
	res = min(prod1, prod2)
	print(res)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 10 ** 18
	for i in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b, x, y) = (b, a, y, x)
	print(ans)


t = int(input())
while t:
	t = t - 1
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		if a - x > n:
			a1 = (a - n) * b
		else:
			a1 = x * (a + b - n - x)
		if b - y > n:
			a2 = (b - n) * a
		else:
			a2 = y * (a + b - n - y)
		m1 = min(a1, a2)
		print(m1)


def find_left(a, b, x, y, n):
	diff = b - y
	if diff >= n:
		return a * (b - n)
	else:
		n -= diff
		b = y
		diff2 = a - x
		if diff2 >= n:
			return b * (a - n)
		else:
			return b * x

def find_right(a, b, x, y, n):
	diff = a - x
	if diff >= n:
		return b * (a - n)
	else:
		n -= diff
		a = x
		diff2 = b - y
		if diff2 >= n:
			return a * (b - n)
		else:
			return a * y
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = find_left(a, b, x, y, n)
	ans2 = find_right(a, b, x, y, n)
	print(min(ans1, ans2))


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

def print(x):
	sys.stdout.write(str(x) + '\n')
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	mi = min(a - x, n)
	a -= mi
	if mi != n:
		b -= min(b - y, n - mi)
	ans1 = a * b
	mi = min(b1 - y, n)
	b1 -= mi
	if mi != n:
		a1 -= min(a1 - x, n - mi)
	ans = a1 * b1
	print(min(ans1, ans))


def f(a, b, x, y, n):
	b_ = max(b - n, y)
	diff = b - b_
	n = n - diff
	a_ = max(a - n, x)
	return a_ * b_
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(f(a, b, x, y, n), f(b, a, y, x, n)))


import math

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	(a, b, x, y, n) = Read.list_int()
	n2 = n
	res1 = a - min(a - x, n)
	n = n - min(a - x, n)
	res1 = res1 * (b - min(b - y, n))
	res2 = b - min(b - y, n2)
	n2 = n2 - min(b - y, n2)
	res2 = res2 * (a - min(a - x, n2))
	print(res2 if res2 < res1 else res1)
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


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


for i in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	toRemove = min(a1 - x1, n1)
	n1 -= toRemove
	a1 -= toRemove
	toRemove = min(n1, b1 - y1)
	n1 -= toRemove
	b1 -= toRemove
	ans1 = a1 * b1
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	toRemove = min(b1 - y1, n1)
	n1 -= toRemove
	b1 -= toRemove
	toRemove = min(n1, a1 - x1)
	n1 -= toRemove
	a1 -= toRemove
	ans2 = a1 * b1
	print(min(ans1, ans2))


import math
for i in range(int(input())):
	(a, b, x, y, n) = [*map(int, input().split())]
	diff1 = a - x
	diff2 = b - y
	if n >= diff1 + diff2:
		print(x * y)
	else:
		val1 = 0
		val2 = 0
		val3 = 0
		val4 = 0
		if n >= diff1:
			val1 = x * (b - (n - diff1))
		else:
			val1 = (a - n) * b
		if n >= diff2:
			val2 = y * (a - (n - diff2))
		else:
			val2 = (b - n) * a
		print(min(val1, val2))


def minproduct(a, x, b, y, n):
	if a - x >= n:
		a -= n
	else:
		n -= a - x
		a = x
		if b - y >= n:
			b -= n
		else:
			b = y
	return a * b
for tt in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	f1 = minproduct(a, x, b, y, n)
	f2 = minproduct(b, y, a, x, n)
	print(min(f1, f2))


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from collections import defaultdict
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, OrderedDict

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

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

def Neo():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(I()):
	(a, b, x, y, n) = neo()
	print(min(max(x, a - n) * max(y, b - max(n - (a - x), 0)), max(y, b - n) * max(x, a - max(n - (b - y), 0))))


(T,) = map(int, input().split())
for _ in range(T):
	(a, b, c, d, n) = map(int, input().split())
	if a < b:
		(a, b, c, d) = (b, a, d, c)
	if a - c + b - d <= n:
		print(c * d)
		continue
	if n <= b - d:
		x = a * (b - n)
	else:
		x = (a - (n - b + d)) * d
	if n <= a - c:
		y = (a - n) * b
	else:
		y = (b - (n - a + c)) * c
	print(min(x, y))


def func(a, b, x, y, n):
	maxy = max(a, b)
	mini = min(a, b)
	if mini == a:
		(t1, t2) = (x, y)
	if mini == b:
		(t1, t2) = (y, x)
	gap1 = mini - t1
	gap2 = maxy - t2
	(s3, s2) = (None, None)
	if n >= gap1 + gap2:
		maxy = maxy - gap2
		mini = mini - gap1
		return maxy * mini
	else:
		if n <= gap1:
			mini = mini - n
			return maxy * mini
		if n <= gap2:
			maxyy = maxy - n
			s2 = maxyy * mini
		else:
			dif = n - gap2
			maxyy = maxy - gap2
			minii = mini - dif
			s3 = maxyy * minii
		if s3 is None:
			s3 = float('inf')
		if s2 is None:
			s2 = float('inf')
		dif = n - gap1
		mini = mini - gap1
		maxy = maxy - dif
		s1 = maxy * mini
		return min(s1, s2, s3)
k = int(input())
for _ in range(k):
	kk = input()
	(a, b, x, y, n) = (int(kk.split()[0]), int(kk.split()[1]), int(kk.split()[2]), int(kk.split()[3]), int(kk.split()[4]))
	res = func(a, b, x, y, n)
	print(res)


import sys
import math
from math import *
from collections import Counter, defaultdict, deque
lip = lambda : list(map(int, input().split()))
ip = lambda : int(input())
sip = lambda : input().split()

def main():
	(a, b, x, y, n) = lip()
	(n1, n2) = (a - x, b - y)
	if a - min(n1, n) < b - min(n2, n):
		temp = min(n1, n)
		a -= temp
		n -= temp
		b -= min(n2, n)
	else:
		temp = min(n2, n)
		b -= temp
		n -= temp
		a -= min(n1, n)
	print(a * b)
for i in range(ip()):
	main()


MOD = 1000000007
from collections import defaultdict as dd, Counter, deque

def si():
	return input()

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

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

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

def out(v):
	print(v)

def spout():
	print(v, end=' ')

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

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

def vow():
	return ['a', 'e', 'i', 'o', 'u']

def let():
	return [chr(i) for i in range(97, 123)]

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

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

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def solve(a, b, x, y, n):
	a1 = a - n if a - n >= x else x
	n -= a - a1
	b1 = b - n if b - n >= y else y
	return a1 * b1
t = ii()
while t:
	t -= 1
	(a, b, x, y, n) = mi()
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))


import math
numbers = {}

def recursive(a, b, x, y, n):
	if n == 0:
		return a * b
	val = numbers.get(str(a) + ',' + str(b))
	if val != None:
		return val
	numbers[str(a) + ',' + str(b)] = a * b
	v1 = a * b
	v2 = v1
	if a > x:
		v1 = recursive(a - 1, b, x, y, n - 1)
	if b > y:
		v2 = recursive(a, b - 1, x, y, n - 1)
	return min(v1, v2)
t = int(input())
for i in range(0, t, 1):
	ip_string = input()
	nums = [int(n) for n in ip_string.split()]
	a = nums[0]
	b = nums[1]
	x = nums[2]
	y = nums[3]
	n = nums[4]
	diff1 = a - x
	diff2 = b - y
	min_first = min(a, b)
	prod1 = 0
	prod2 = 0
	flag1 = 1
	flag2 = 1
	if min_first == a:
		if a - n >= x:
			a = a - n
			n = 0
		if diff1 >= n:
			a = a - n
			n = 0
		if n > diff1:
			a = a - diff1
			n = n - diff1
		while a > x and n > 0:
			a = a - 1
			n = n - 1
		if b - n >= y:
			b = b - n
			n = 0
		if diff2 >= n:
			b = b - n
			n = 0
		if n > diff2:
			b = b - diff2
			n = n - diff2
		while b > y and n > 0:
			b = b - 1
			n = n - 1
		prod1 = a * b
		a = nums[0]
		b = nums[1]
		n = nums[4]
		if b - n >= y:
			b = b - n
			n = 0
		if diff2 >= n:
			b = b - n
			n = 0
		if n > diff2:
			b = b - diff2
			n = n - diff2
		while b > y and n > 0:
			b = b - 1
			n = n - 1
		if a - n >= x:
			a = a - n
			n = 0
		if diff1 >= n:
			a = a - n
			n = 0
		if n > diff1:
			a = a - diff1
			n = n - diff1
		while a > x and n > 0:
			a = a - 1
			n = n - 1
		prod2 = a * b
	else:
		if b - n >= y:
			b = b - n
			n = 0
		if diff2 >= n:
			b = b - n
			n = 0
		if n > diff2:
			b = b - diff2
			n = n - diff2
		while b > y and n > 0:
			b = b - 1
			n = n - 1
		if a - n >= x:
			a = a - n
			n = 0
		if diff1 >= n:
			a = a - n
			n = 0
		if n > diff1:
			a = a - diff1
			n = n - diff1
		while a > x and n > 0:
			a = a - 1
			n = n - 1
		prod2 = a * b
		a = nums[0]
		b = nums[1]
		n = nums[4]
		if a - n >= x:
			a = a - n
			n = 0
		if diff1 >= n:
			a = a - n
			n = 0
		if n > diff1:
			a = a - diff1
			n = n - diff1
		while a > x and n > 0:
			a = a - 1
			n = n - 1
		if b - n >= y:
			b = b - n
			n = 0
		if diff2 >= n:
			b = b - n
			n = 0
		if n > diff2:
			b = b - diff2
			n = n - diff2
		while b > y and n > 0:
			b = b - 1
			n = n - 1
		prod1 = a * b
	min_product = min(prod1, prod2)
	print(min_product)


import sys
import string
import math
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache
from fractions import Fraction

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

def lmi(s):
	return list(mi(s))

def tmi(s):
	return tuple(mi(s))

def mf(f, s):
	return map(f, s)

def lmf(f, s):
	return list(mf(f, s))

def js(lst):
	return ' '.join((str(d) for d in lst))

def jsns(lst):
	return ''.join((str(d) for d in lst))

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

def linesp():
	return line().split()

def iline():
	return int(line())

def mat(n):
	matr = []
	for _ in range(n):
		matr.append(linesp())
	return matr

def matns(n):
	mat = []
	for _ in range(n):
		mat.append([c for c in line()])
	return mat

def mati(n):
	mat = []
	for _ in range(n):
		mat.append(lmi(line()))
	return mat

def pmat(mat):
	for row in mat:
		print(js(row))

def solve():
	(a, b, x, y, n) = mi(line())
	(aa, bb) = (a, b)
	oldb = b
	b = max(b - n, y)
	left = n - (oldb - b)
	a = max(a - left, x)
	best = a * b
	(a, b) = (aa, bb)
	olda = a
	a = max(a - n, x)
	left = n - (olda - a)
	b = max(b - left, y)
	best = min(best, a * b)
	print(best)

def main():
	t = iline()
	for _ in range(t):
		solve()
main()


def get(a, b, x, y, n):
	opa = min(a - x, n)
	n -= opa
	a -= opa
	opb = min(b - y, n)
	n -= opb
	b -= opb
	return a * b
T = int(input())
for _ in range(T):
	(a, b, x, y, n) = map(int, input().split())
	print(min(get(a, b, x, y, n), get(b, a, y, x, n)))


from sys import stdin, stdout

def ab(a, b, x, y, n):
	(b, n) = (b - min(n, b - y), n - min(n, b - y))
	if n > 0:
		a -= min(n, a - x)
	return a * b

def ba(a, b, x, y, n):
	(a, n) = (a - min(n, a - x), n - min(n, a - x))
	if n > 0:
		b -= min(n, b - y)
	return a * b
for _ in range(int(stdin.readline())):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	print(min(ab(a, b, x, y, n), ba(a, b, x, y, n)))


for l in [*open(0)][1:]:
	(a, b, x, y, n) = map(int, l.split())
	p = []
	for (q, w, e, r) in ((a, b, x, y), (b, a, y, x)):
		i = min(q - e, n)
		j = min(w - r, n - i)
		p.append((q - i) * (w - j))
	print(min(p))


T = int(input())

def main():
	(a, b, x, y, n) = tuple(map(int, input().split()))
	A = a
	B = b
	N = n
	if A > x and N > 0:
		max_reduction = min(A - x, N)
		A -= max_reduction
		N -= max_reduction
	if N > 0:
		max_reduction = min(B - y, N)
		B -= max_reduction
	if b > y and n > 0:
		max_reduction = min(b - y, n)
		b -= max_reduction
		n -= max_reduction
	if n > 0:
		max_reduction = min(a - x, n)
		a -= max_reduction
	return min(A * B, a * b)
for _ in range(T):
	print(main())


def ans():
	N = int(input())
	for i in range(N):
		ans = input().split()
		a = int(ans[0])
		b = int(ans[1])
		c = int(ans[2])
		d = int(ans[3])
		n = int(ans[4])
		if a - c > n and b - d > n:
			print(int(min(a - n, b - n)) * int(max([a, b])))
		elif a - c <= n and b - d >= n:
			if min([c, b - n]) == b - n:
				print((b - n) * a)
			else:
				print(c * (b - (n - (a - c))))
		elif a - c >= n and b - d <= n:
			if min([a - n, d]) == a - n:
				print((a - n) * b)
			else:
				print(d * (a - (n - (b - d))))
		elif n >= a - c + b - d:
			print(c * d)
		elif min([c, d]) == c:
			print(c * (b - (n - (a - c))))
		else:
			print(d * (a - (n - (b - d))))
ans()


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	p = max(a - n, x)
	nn = a - p
	np = n - nn
	pro1 = p * max(b - np, y)
	q = max(b - n, y)
	nn_1 = b - q
	nq = n - nn_1
	pro2 = q * max(a - nq, x)
	print(min(pro2, pro1))


def f(a, b, x, y):
	p1 = a - min(n, a - x)
	if p1 + n <= a:
		r1 = 0
	else:
		r1 = n - a + x
	q1 = b - min(r1, b - y)
	return p1 * q1
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(f(a, b, x, y), f(b, a, y, x)))


t = int(input())
z = []
for i in range(t):
	z.append(input())
for i in range(t):
	(a, b, x, y, n) = (int(z[i].split()[0]), int(z[i].split()[1]), int(z[i].split()[2]), int(z[i].split()[3]), int(z[i].split()[4]))
	(a1, a2, b1, b2, n1, n2) = (a, a, b, b, n, n)
	d = a1
	a1 -= min(n1, a1 - x)
	n1 -= d - a1
	d = b1
	b1 -= min(n1, b1 - y)
	d = b2
	b2 -= min(n2, b2 - y)
	n2 -= d - b2
	d = a2
	a2 -= min(n2, a2 - x)
	print(min(a1 * b1, a2 * b2))


t = int(input())
for i in range(t):
	flag = 1
	(a, b, x, y, n) = map(int, input().split())
	while n > 0:
		minreacha = max(x, a - n)
		minreachb = max(y, b - n)
		if minreacha >= minreachb and b != minreachb:
			n = n - (b - minreachb)
			b = minreachb
		elif minreachb > minreacha and a != minreacha:
			n = n - (a - minreacha)
			a = minreacha
		elif a == minreacha and b == minreachb:
			break
		elif minreachb == b:
			a = minreacha
			break
		elif minreacha == a:
			b = minreachb
			break
	print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	num1 = a - x
	num2 = b - y
	(A, B, Num1, Num2, N) = (b, a, num2, num1, n)
	if num1 > n:
		a -= n
		n = 0
	else:
		n -= num1
		a -= num1
	if n:
		if num2 > n:
			b -= n
		else:
			b -= num2
	if Num1 > N:
		A -= N
		N = 0
	else:
		N -= Num1
		A -= Num1
	if N:
		if Num2 > N:
			B -= N
		else:
			B -= Num2
	print(min(a * b, A * B))


from __future__ import division, print_function
from itertools import permutations
import threading, bisect, math, heapq, sys
from sys import stdin, stdout
i_m = 9223372036854775807

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

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

def sin():
	return input()

def inin():
	return int(input())
prime = []

def dfs(n, d, v):
	v[n] = 1
	x = d[n]
	for i in x:
		if i not in v:
			dfs(i, d, v)
	return p

def main():
	t = inin()
	for _ in range(t):
		(a, b, x, y, n) = cin()
		p = min(n, a - x)
		q = min(n, b - y)
		aa = a
		bb = b
		aa -= p
		bb -= q
		pp = min(n - p, b - y)
		qq = min(n - q, a - x)
		b -= pp
		a -= qq
		print(min(a * bb, aa * b))
fac = []

def fact(n, mod):
	global fac
	fac.append(1)
	for i in range(1, n + 1):
		fac.append(fac[i - 1] * i % mod)
	f = fac[:]
	return f

def nCr(n, r, mod):
	global fac
	x = fac[n]
	y = fac[n - r]
	z = fac[r]
	x = moddiv(x, y, mod)
	return moddiv(x, z, mod)

def moddiv(m, n, p):
	x = pow(n, p - 2, p)
	return m * x % p

def GCD(x, y):
	x = abs(x)
	y = abs(y)
	if min(x, y) == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def Divisors(n):
	l = []
	ll = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				ll.append(n // i)
	l.extend(ll[::-1])
	return l

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f

def primeFactors(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			a.append(i)
			n = n // i
	if n > 2:
		a.append(n)
	return a
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

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

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'R'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'R'[0]:
		A.append(sign * numb)
	return A
main()


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	za = max(a - n, x)
	zb = max(b - n, y)
	zan = 0 if za + n == a else n - (a - x)
	zbn = 0 if zb + n == b else n - (b - y)
	print(min(za * (b - min(zan, b - y)), zb * (a - min(zbn, a - x))))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	mi = min(n, b - y)
	b = b - mi
	n = n - mi
	a = a - min(n, a - x)
	mi = min(n1, a1 - x1)
	a1 = a1 - mi
	n1 = n1 - mi
	b1 = b1 - min(n1, b1 - y1)
	q = min(a * b, a1 * b1)
	print(q)


import math
from decimal import Decimal
import heapq
import copy
import heapq
from collections import deque
from collections import defaultdict
MOD = 1000000007

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def da():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	return (n, m, a)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def lol(lst, k):
	k = k % len(lst)
	ret = [0] * len(lst)
	for i in range(len(lst)):
		if i + k < len(lst) and i + k >= 0:
			ret[i] = lst[i + k]
		if i + k >= len(lst):
			ret[i] = lst[i + k - len(lst)]
		if i + k < 0:
			ret[i] = lst[i + k + len(lst)]
	return ret

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)

def fact(n):
	tc = []
	ans = {}
	d = 2
	while d * d <= n:
		if n % d == 0:
			tc.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		tc.append(n)
	for i in tc:
		ans[i] = ans.get(i, 0) + 1
	return ans

def to_zero(n, s):
	lst = s[0]
	ans = []
	for i in range(n):
		if lst == s[i]:
			continue
		elif lst == '0':
			lst = '1'
			ans.append(i)
		else:
			lst = '0'
			ans.append(i)
	if lst == '1':
		ans.append(n)
	return ans
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ac = a
	bc = b
	nc = n
	ans1 = 0
	ans2 = 0
	d = a - x
	if d <= n:
		n -= d
		a = x
	else:
		a -= n
		n = 0
	b -= min(b - y, n)
	ans1 = a * b
	d = bc - y
	if d <= nc:
		nc -= d
		bc = y
	else:
		bc -= nc
		nc = 0
	ac -= min(ac - x, nc)
	ans2 = ac * bc
	print(min(ans1, ans2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	per_0 = max(a - n, x)
	per_0_1 = max(b - (n - abs(a - per_0)), y)
	first = per_0 * per_0_1
	per_1 = max(b - n, y)
	per_1_1 = max(a - (n - abs(b - per_1)), x)
	second = per_1 * per_1_1
	print(min(first, second))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	min1 = min(n, a - x)
	min2 = min(n - min1, b - y)
	ans1 = (a - min1) * (b - min2)
	min3 = min(n, b - y)
	min4 = min(n - min3, a - x)
	ans2 = (b - min3) * (a - min4)
	print(min(ans1, ans2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	am = max(a - n, x)
	bm = max(b - n, y)
	if am < bm:
		nr = n - (a - am)
		bm = max(b - nr, y)
	else:
		nr = n - (b - bm)
		am = max(a - nr, x)
	print(am * bm)


import sys
t = int(input())
while t > 0:
	t -= 1
	input = sys.stdin.readline()
	(a, b, x, y, n) = map(int, input.split())
	if a + b - x - y <= n:
		print(x * y)
	elif a - n >= x and b - n >= y:
		print(min(a - n, b - n) * max(a, b))
	elif a - n < x and b - n < y:
		print(min(x * (a + b - n - x), y * (a + b - n - y)))
	elif a - n < x:
		print(min(x * (a + b - n - x), a * (b - n)))
	else:
		print(min(y * (a + b - n - y), b * (a - n)))


for _ in range(int(input())):
	(a, b, x, y, k) = [int(x) for x in input().split()]
	p = max(a - k, x)
	diff = a - p
	q = max(b - (k - diff), y)
	ss = p * q
	q = max(b - k, y)
	diff = b - q
	p = max(a - (k - diff), x)
	ss = min(ss, p * q)
	print(ss)


import math

def solve(a, b, x, y, n):
	ans = math.inf
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	n1 = n
	for i in range(2):
		if i == 0:
			left = a1 - x1
			if left <= n1:
				n1 -= left
				a1 -= left
			else:
				a1 -= n1
				ans = min(ans, a1 * b1)
				continue
			left2 = b1 - y1
			if left2 <= n1:
				n1 -= left2
				b1 -= left2
				ans = min(ans, a1 * b1)
				continue
			else:
				b1 -= n1
				ans = min(ans, a1 * b1)
				continue
		if i == 1:
			left = b - y
			if left <= n:
				n -= left
				b -= left
			else:
				b -= n
				ans = min(ans, a * b)
				break
			left2 = a - x
			if left2 <= n:
				n -= left2
				a -= left2
				ans = min(ans, a * b)
				break
			else:
				a -= n
				ans = min(ans, a * b)
				break
	print(ans)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	solve(a, b, x, y, n)


t_count = int(input().strip())
while t_count > 0:
	(temp_a, temp_b, x, y, temp_n) = list(map(int, input().strip().split(' ')))
	(val_0, val_1) = (0, 0)
	(a, b, n) = (temp_a, temp_b, temp_n)
	(diff_0, diff_1) = (a - x, b - y)
	if diff_0 <= n:
		n -= diff_0
		a = x
		if diff_1 <= n:
			n -= diff_1
			b = y
		else:
			b -= n
			n = 0
	else:
		a -= n
		n = 0
	val_0 = a * b
	(a, b, n) = (temp_a, temp_b, temp_n)
	(diff_0, diff_1) = (b - y, a - x)
	if diff_0 <= n:
		n -= diff_0
		b = y
		if diff_1 <= n:
			n -= diff_1
			a = x
		else:
			a -= n
			n = 0
	else:
		b -= n
		n = 0
	val_1 = a * b
	print(min(val_0, val_1))
	t_count -= 1


test = int(input())
for _ in range(test):
	(a, b, x, y, n) = map(int, input().split())
	(diff1, diff2) = (a - x, b - y)
	value = 1
	if n >= diff1 + diff2:
		value = x * y
	else:
		a1 = max(x, a - n)
		m = n - (a - a1)
		b1 = max(y, b - m)
		value = a1 * b1
		b1 = max(y, b - n)
		m = n - (b - b1)
		a1 = max(x, a - m)
		value = min(value, a1 * b1)
	print(value)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	orig = a * b
	(a1, b1, n1) = (a, b, n)
	take = min(n1, a1 - x)
	a1 -= take
	n1 -= take
	take = min(n1, b1 - y)
	b1 -= take
	d1 = a1 * b1
	(a2, b2, n2) = (a, b, n)
	take = min(n2, b2 - y)
	b2 -= take
	n2 -= take
	take = min(n2, a2 - x)
	a2 -= take
	d2 = a2 * b2
	print(max(x * y, min(d1, d2)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if x < y:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a <= b and b - n >= x:
		(a, n) = (max(x, a - n), max(0, n - a + x))
		b -= min(n, b - y)
	else:
		(b, n) = (max(y, b - n), max(0, n - b + y))
		a -= min(n, a - x)
	print(a * b)


import sys
sysinput = sys.stdin.readline
import time
start_time = time.time()

def inp():
	return int(sysinput())

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

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

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

def decrease(num, constraint, n):
	diff = num - constraint
	if n >= diff:
		num = constraint
		n -= diff
	elif n < diff:
		num -= n
		n = 0
	return (num, n)
t = inp()
while t > 0:
	t -= 1
	(a, b, x, y, n) = inlt()
	(c, n1) = decrease(a, x, n)
	(d, n1) = decrease(b, y, n1)
	area1 = c * d
	(d, n2) = decrease(b, y, n)
	(c, n2) = decrease(a, x, n2)
	area2 = c * d
	print(min(area1, area2))


for t in range(int(input())):
	(a, b, x, y, n) = input().split()
	(a, b, x, y, n) = (int(a), int(b), int(x), int(y), int(n))
	min_a = max(x, a - n)
	min_b = max(y, b - n)
	ans1 = 0
	ans2 = 0
	tn = n
	if a - min_a < n:
		tn -= a - min_a
		tb = max(y, b - tn)
		ans1 = min_a * tb
	else:
		ans1 = min_a * b
	tn = n
	if b - min_b < n:
		tn -= b - min_b
		ta = max(x, a - tn)
		ans2 = min_b * ta
	else:
		ans2 = min_b * a
	print(min(ans1, ans2))


def min_product(a, b, x, y, n):
	pair = [a, b]
	pair_lims = [x, y]
	pair_check = [pair[i] > pair_lims[i] for i in range(2)]
	if n > a - x + (b - y):
		return x * y
	while n > 0 and any(pair_check):
		res = [max(pair_lims[i], pair[i] - min(pair[i], n)) for i in range(2)]
		which = res[1] == min(res)
		index = 1 * (not which ^ pair_check[1 * which])
		max_change = min(pair[index] - pair_lims[index], n)
		pair[index] -= max_change
		n -= max_change
		pair_check = [pair[i] > pair_lims[i] for i in range(2)]
	return pair[0] * pair[1]
t = int(input())
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	print(min_product(a, b, x, y, n))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(c, d, m) = (a, b, n)
	if a - x >= n:
		a -= n
		n = 0
	else:
		n -= a - x
		a = x
		b = b - n if n <= b - y else y
	q = a * b
	if d - y >= m:
		d -= m
		m = 0
	else:
		m -= d - y
		d = y
		c = c - m if m <= c - x else x
	q = min(q, c * d)
	print(q)


for m in range(int(input())):
	abxyn = list(map(int, input().split()))
	a1 = abxyn[0]
	a2 = abxyn[0]
	b1 = abxyn[1]
	b2 = abxyn[1]
	n1 = abxyn[4]
	n2 = abxyn[4]
	temp = min(a1 - abxyn[2], n1)
	a1 -= temp
	n1 -= temp
	temp = min(b1 - abxyn[3], n1)
	b1 -= temp
	temp = min(b2 - abxyn[3], n2)
	b2 -= temp
	n2 -= temp
	temp = min(a2 - abxyn[2], n2)
	a2 -= temp
	print(min(a1 * b1, a2 * b2))


def solve(a, b, x, y, n):
	if a < b:
		(a, b, x, y) = (b, a, y, x)
	p = a - x
	q = b - y
	if n >= p + q:
		return x * y
	if q >= n:
		return a * (b - n)
	z = p + q - n
	s1 = y * (a + z - p)
	if p >= n:
		s2 = (a - n) * b
	else:
		s2 = x * (b + z - q)
	return min([s1, s2])
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	print(solve(a, b, x, y, n))


import sys
import time as mt, bisect, sys
import math
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict

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

def st():
	return stdin.readline()

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

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

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

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)
test = si()
for _ in range(test):
	(a, b, x, y, num) = mi()
	ans = 0
	count1 = a
	d = b
	count2 = num
	count3 = 0
	res = 0
	count3 = count1 - x
	if count3 <= count2:
		count2 -= count3
		count1 -= count3
	else:
		count3 = count2
		count2 = 0
		count1 -= count3
	res = d - y
	if res <= count2:
		count2 -= res
		d -= res
	else:
		res = count2
		count2 = 0
		d -= res
	ans = count1 * d
	result1 = 0
	result2 = 0
	result1 = b - y
	if result1 <= num:
		num -= result1
		b -= result1
	else:
		result1 = num
		num = 0
		b -= result1
	result2 = a - x
	if result2 <= num:
		num -= result2
		a -= result2
	else:
		result2 = num
		num = 0
		a -= result2
	ans = min(a * b, ans)
	print(ans)


def solve(a, b, x, y, n):
	(c, d, m) = (a, b, n)
	temp = d - y
	d -= min(m, temp)
	m -= min(m, temp)
	c -= m
	if c < x:
		c = x
	temp = a - x
	a -= min(n, temp)
	n -= min(n, temp)
	b -= n
	if b < y:
		b = y
	print(min(a * b, c * d))
t = int(input())
for _ in range(t):
	inp = input().split()
	(a, b, x, y, n) = (int(inp[0]), int(inp[1]), int(inp[2]), int(inp[3]), int(inp[4]))
	solve(a, b, x, y, n)


t = int(input())
for _ in range(t):
	(a, b, c, d, k) = map(int, input().split())
	tot = a + b - k
	if tot < c + d:
		print(c * d)
		continue
	ans = 1e+18
	if d <= tot - a <= b:
		ans = min(ans, a * (tot - a))
	if d <= tot - c <= b:
		ans = min(ans, c * (tot - c))
	if c <= tot - b <= a:
		ans = min(ans, b * (tot - b))
	if c <= tot - d <= a:
		ans = min(ans, d * (tot - d))
	print(ans)


t = int(input())
for tt in range(t):
	(a, b, x, y, n) = map(int, input().split())
	c = a - x
	d = b - y
	if n >= c + d:
		print(x * y)
		continue
	if x == 1 and n >= c:
		print(b - (n - c))
		continue
	if y == 1 and n >= d:
		print(a - (n - d))
		continue
	c = a - x
	d = b - y
	if n >= c:
		i = x * (b - (n - c))
	else:
		i = (a - n) * b
	if n >= d:
		j = y * (a - (n - d))
	else:
		j = (b - n) * a
	print(min(i, j))


t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	k = min(max(a - n, x), max(b - n, y))
	if k == max(a - n, x):
		rem = a - k
		if rem < n:
			n -= rem
			k1 = max(b - n, y)
			ans = k * k1
		else:
			ans = k * b
	else:
		rem = b - k
		if rem < n:
			n -= rem
			k1 = max(a - n, x)
			ans = k * k1
		else:
			ans = k * a
	print(ans)


def func(a, b, x, y, n):
	if a - x <= n:
		n = n - (a - x)
		a = x
	else:
		a = a - n
		n = 0
	b = max(y, b - n)
	return a * b
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(func(a, b, x, y, n), func(b, a, y, x, n)))


t = int(input())
while t > 0:
	(a, b, c, d, n) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	n = int(n)
	diff = 0
	min_val = 0
	r_a = a
	r_b = b
	r_n = n
	diff = a - c
	min_val = min(diff, n)
	a = a - min_val
	n = n - min_val
	diff = b - d
	min_val = min(diff, n)
	b = b - min_val
	ans1 = a * b
	a = r_a
	b = r_b
	n = r_n
	diff = b - d
	min_val = min(diff, n)
	b = b - min_val
	n = n - min_val
	diff = a - c
	min_val = min(diff, n)
	a = a - min_val
	ans2 = a * b
	if ans1 < ans2:
		print(ans1)
	else:
		print(ans2)
	t = t - 1


t = int(input())
for _ in range(t):
	inp = input().split()
	a = int(inp[0])
	b = int(inp[1])
	x = int(inp[2])
	y = int(inp[3])
	n = int(inp[4])
	if max(a - n, x) < max(b - n, y):
		dec = a - max(a - n, x)
		a -= dec
		n -= dec
		if n > 0:
			b = max(b - n, y)
	else:
		dec = b - max(b - n, y)
		b -= dec
		n -= dec
		if n > 0:
			a = max(a - n, x)
	print(a * b)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	p = max(a - n, x)
	q = max(b - n, y)
	b1 = max(b - (n - (a - p)), y)
	mult1 = b1 * p
	a1 = max(a - (n - (b - q)), x)
	mult2 = q * a1
	print(min(mult1, mult2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if abs(a - x) < abs(b - y):
		(a, b) = (b, a)
		(x, y) = (y, x)
	te = min(abs(a - x), n)
	te_a = a
	te_b = b
	te_n = n
	te_n -= te
	te_a -= te
	te_b -= min(abs(b - y), te_n)
	ans = te_a * te_b
	te = min(abs(b - y), n)
	te_a = b
	te_b = a
	te_n = n
	te_n -= te
	te_a -= te
	te_b -= min(abs(a - x), te_n)
	ans = min(ans, te_a * te_b)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	d1 = a - x
	d2 = b - y
	c1 = 0
	c2 = 0
	ta = a
	tb = b
	if d1 < n:
		r = n - d1
		a = x
		if d2 < r:
			b = y
			c1 = a * b
		else:
			b -= r
			c1 = a * b
	else:
		a -= n
		c1 = a * b
	(a, b) = (tb, ta)
	(x, y) = (y, x)
	(d1, d2) = (d2, d1)
	if d1 < n:
		r = n - d1
		a = x
		if d2 < r:
			b = y
			c2 = a * b
		else:
			b -= r
			c2 = a * b
	else:
		a -= n
		c2 = a * b
	print(min(c1, c2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - n >= x:
		ans1 = (a - n) * b
	else:
		n1 = n - (a - x)
		if b - n1 >= y:
			ans1 = x * (b - n1)
		else:
			ans1 = x * y
	if b - n >= y:
		ans2 = a * (b - n)
	else:
		n1 = n - (b - y)
		if a - n1 >= x:
			ans2 = y * (a - n1)
		else:
			ans2 = x * y
	print(min(ans1, ans2))


def calc(a, b, x, y, n):
	min_a = max(a - n, x)
	min_b = max(b - n, y)
	if min_a < min_b:
		d_a = a - min_a
		n -= d_a
		d_b = b - max(y, b - n)
	else:
		d_b = b - min_b
		n -= d_b
		d_a = a - max(x, a - n)
	res = (a - d_a) * (b - d_b)
	return res

def get_ints():
	return [int(n) for n in input().split()]

def get_floats():
	return [float(n) for n in input().split()]

def seq2str(seq):
	return ' '.join((str(item) for item in seq))
zzz = get_ints()
assert len(zzz) == 1
t = zzz[0]
for i in range(t):
	zzz = get_ints()
	assert len(zzz) == 5
	(a, b, x, y, n) = (zzz[0], zzz[1], zzz[2], zzz[3], zzz[4])
	assert a >= x and b >= y
	res = calc(a, b, x, y, n)
	print(res)


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline

def f1(n1, n2, l1, l2, time):
	tt = min(n1 - l1, time)
	time -= tt
	n1 -= tt
	tt = min(n2 - l2, time)
	n2 -= tt
	return n1 * n2
for ii in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(f1(a, b, x, y, n), f1(b, a, y, x, n)))


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	(a, b, min_a, min_b, k) = list(map(int, stdin.readline().split()))
	op_a = op_b = -1
	prod1 = prod2 = float('inf')
	if a >= min_a:
		op_a = a - min_a
	if b >= min_b:
		op_b = b - min_b
	if op_a >= 0:
		red_a = min(op_a, k)
		rem = k - red_a
		remb = b - rem
		if remb < min_b:
			remb = min_b
		prod1 = (a - red_a) * remb
	if op_b >= 0:
		red_b = min(op_b, k)
		rem = k - red_b
		rema = a - rem
		if rema < min_a:
			rema = min_a
		prod2 = (b - red_b) * rema
	print(min(prod1, prod2))


def solve():
	(a, b, x, y, n) = map(int, input().split())
	a1 = max(a - n, x)
	n1 = n - a + a1
	b1 = max(y, b - n1)
	b2 = max(y, b - n)
	n2 = n - b + b2
	a2 = max(x, a - n2)
	print(min(a1 * b1, a2 * b2))
for cnt in range(int(input())):
	solve()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	k = min(a - x, n)
	A = a - min(a - x, n)
	N = n - min(a - x, n)
	B = b - min(b - y, N)
	max1 = A * B
	l = min(b - y, n)
	B1 = b - min(b - y, n)
	N1 = n - min(b - y, n)
	A1 = a - min(a - x, N1)
	max2 = A1 * B1
	print(min(max1, max2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	d1 = (a - min(a - x, n)) * (b - min(b - y, n - min(a - x, n)))
	d2 = (b - min(b - y, n)) * (a - min(a - x, n - min(b - y, n)))
	print(min(d1, d2))


def func1(a, b, x, y, n):
	init_a = a
	a = max(x, a - n)
	n = n - (init_a - a)
	b = max(y, b - n)
	return a * b

def func2(a, b, x, y, n):
	init_b = b
	b = max(y, b - n)
	n = n - (init_b - b)
	a = max(x, a - n)
	return a * b
t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	val1 = func1(a, b, x, y, n)
	val2 = func2(a, b, x, y, n)
	print(min(val1, val2))


import sys
input = sys.stdin.readline
from bisect import bisect_left
from bisect import bisect_right
from math import ceil, factorial

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

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

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

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

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

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

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

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

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

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

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

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

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	inp = int_array()
	(a, b, x, y, n) = inp
	if a - x >= n:
		a -= n
	else:
		n -= a - x
		a = x
		if b - y >= n:
			b -= n
		else:
			b = y
	ans1 = a * b
	(a, b, x, y, n) = inp
	if b - y >= n:
		b -= n
	else:
		n -= b - y
		b = y
		if a - x >= n:
			a -= n
		else:
			a = x
	ans2 = a * b
	print(min(ans1, ans2))


testcases = int(input())
lis = []
for i in range(testcases):
	(a, b, x, y, n) = input().split(' ')
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	los = (a, b, x, y, n)
	lis.append(los)

def minim(a, b, x, y, n):
	if a >= b:
		if b - n >= y:
			print(a * (b - n))
		elif a - n + b - y >= x:
			min1 = y * (a - n + b - y)
			if a - n >= x:
				min2 = b * (a - n)
				print(min(min1, min2))
			elif b - n + a - x >= y:
				min3 = x * (b - n + a - x)
				print(min(min1, min3))
			else:
				print(x * y)
		else:
			print(x * y)
	elif a - n >= x:
		print(b * (a - n))
	elif b - n + a - x >= y:
		min1 = x * (b - n + a - x)
		if b - n >= y:
			min2 = a * (b - n)
			print(min(min1, min2))
		elif a - n + b - y >= x:
			min3 = y * (a - n + b - y)
			print(min(min1, min3))
		else:
			print(x * y)
	else:
		print(x * y)
for i in lis:
	minim(i[0], i[1], i[2], i[3], i[4])


import sys
si = sys.stdin.readline

def main():
	t = int(si())
	while t:
		t -= 1
		(a, b, x, y, n) = [int(e) for e in si().split()]
		(smalla, smallb) = (a - min(a - x, n), b - min(b - y, n))
		if smallb < smalla:
			(a, b) = (b, a)
			(x, y) = (y, x)
		if a - x < n:
			n -= a - x
			a = x
			if b - y < n:
				b = y
			else:
				b -= n
		else:
			a -= n
		print(a * b)
main()


for test in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if max(x, a - x) + max(y, b - y) >= n:
		m1 = max(a - n, x)
		m2 = max(b - n, y)
		if m1 <= m2:
			t = min(a - x, n)
			a = a - t
			n = n - t
			if n > 0:
				b = b - min(n, b - y)
		else:
			t = min(b - y, n)
			b = b - t
			n = n - t
			if n > 0:
				a = a - min(a - x, n)
		print(a * b)
	else:
		print(x * y)


import math
n_test = int(input())
while n_test:
	n_test -= 1
	(a, b, x, y, n) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	(a1, b1, n1) = (a, b, n)
	if b1 - y >= n1:
		b1 -= n1
	else:
		n1 -= b1 - y
		b1 = y
		if a1 - x >= n1:
			a1 -= n1
		else:
			a1 = x
	if a - x >= n:
		a -= n
	else:
		n -= a - x
		a = x
		if b - y >= n:
			b -= n
		else:
			b = y
	if a1 * b1 > a * b:
		print(a * b)
	else:
		print(a1 * b1)


def solve():
	(a, b, x, y, n) = list(map(int, input().split()))
	a1 = a
	b1 = b
	n1 = n
	lst = []
	temp = b - y
	if temp >= n:
		b -= n
		lst.append(a * b)
	else:
		n -= temp
		b -= temp
		a = max(a - n, x)
		lst.append(a * b)
	a = a1
	b = b1
	n = n1
	temp = a - x
	if temp >= n:
		a -= n
		lst.append(a * b)
	else:
		n -= temp
		a -= temp
		b = max(b - n, y)
		lst.append(a * b)
	print(min(lst))
	return
t = int(input())
while t != 0:
	solve()
	t -= 1


t = int(input())
arr = []
for k in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = float('inf')
	for i in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b) = (b, a)
		(x, y) = (y, x)
	arr.append(ans)
for j in arr:
	print(j)


def solve():
	loop = int(input())
	while loop > 0:
		loop -= 1
		(a, b, x, y, n) = map(int, input().split())
		da = a - x
		db = b - y
		tt = []
		if da + db <= n:
			print(x * y)
		else:
			if da < n:
				temp = n - da
				a_t = a - da
				b_t = b - temp
				tt.append(a_t * b_t)
			else:
				tt.append((a - n) * b)
			if db < n:
				temp = n - db
				b_t = b - db
				a_t = a - temp
				tt.append(a_t * b_t)
			else:
				tt.append((b - n) * a)
			print(min(tt))
solve()


from fractions import Fraction
from collections import defaultdict
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

def input():
	return sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	aa1 = a
	bb1 = b
	xx1 = x
	yy1 = y
	nn1 = n
	d1 = a - x
	d2 = b - y
	a -= min(d1, n)
	n -= min(d1, n)
	if n > 0:
		b -= min(n, d2)
	res1 = a * b
	bb1 -= min(d2, nn1)
	nn1 -= min(d2, nn1)
	if nn1 > 0:
		aa1 -= min(nn1, d1)
	res2 = aa1 * bb1
	print(min(res1, res2))


cases = int(input())
for case in range(cases):
	(a, b, x, y, n) = map(int, input().split())
	ta = max(x, a - n)
	tb = max(y, b - (n - (a - ta)))
	ans1 = ta * tb
	tb = max(y, b - n)
	ta = max(x, a - (n - (b - tb)))
	ans2 = ta * tb
	print(min(ans1, ans2))


import sys

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

def read_ints():
	return map(int, sys.stdin.readline().split(' '))
t = read_int()
for case_num in range(t):
	(a, b, x, y, n) = read_ints()
	n1 = min(n, a - x)
	ans = (a - n1) * (b - min(n - n1, b - y))
	n2 = min(n, b - y)
	ans = min(ans, (b - n2) * (a - min(n - n2, a - x)))
	print(ans)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	prod1 = max(a - n, x)
	prod2 = max(b - n, y)
	if prod1 < prod2:
		n -= a - prod1
		prod2 = max(b - n, y)
	else:
		n -= b - prod2
		prod1 = max(a - n, x)
	print(prod1 * prod2)


t = int(input())
for i in range(t):
	(a, b, p, q, n) = map(int, input().split())
	ans = float('inf')
	if n >= a - p:
		s = max(q, b - (n - (a - p)))
		ans = min(ans, p * s)
	else:
		ans = min(ans, (a - n) * b)
	if n >= b - q:
		n -= b - q
		s = max(p, a - n)
		ans = min(ans, q * s)
	else:
		ans = min(ans, (b - n) * a)
	print(max(ans, p * q))


n = input()
p = []
for i in range(0, int(n)):
	l = input()
	t = [int(i) for i in l.split() if i.isdigit()]
	p.append(t)
for i in range(0, len(p)):
	a = p[i][0]
	b = p[i][1]
	x = p[i][2]
	y = p[i][3]
	n = p[i][4]
	if a + b - x - y >= n:
		n1 = max(a - n, x) * (b - (n - (a - max(a - n, x))))
		n2 = max(b - n, y) * (a - (n - (b - max(b - n, y))))
		print(min(n1, n2))
	else:
		print(x * y)


def func1(a, b, x, y, ops):
	op1 = min(a - x, ops)
	a -= op1
	ops -= op1
	op2 = min(b - y, ops)
	b -= op2
	ops -= op2
	return a * b

def func2(a, b, x, y, ops):
	op2 = min(b - y, ops)
	b -= op2
	ops -= op2
	op1 = min(a - x, ops)
	a -= op1
	ops -= op1
	return a * b
for t in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	ops = min(a - x + (b - y), n)
	print(min(func1(a, b, x, y, ops), func2(a, b, x, y, ops)))


from fractions import gcd
from itertools import combinations, permutations, accumulate, product
from collections import deque, defaultdict, Counter
import decimal
import re
import math
import bisect
import sys
sys.setrecursionlimit(10000000)
mod = 10 ** 9 + 7
from sys import stdin
readline = stdin.readline

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

def readTuples():
	return tuple(map(int, readline().split()))

def I():
	return int(readline())
for _ in range(I()):
	(a, b, x, y, n) = readInts()
	ax = min(n, a - x)
	bl = min(b - y, n - ax)
	by = b - bl
	ans_ax = (a - ax) * (b - bl)
	by = min(n, b - y)
	al = min(a - x, n - by)
	ax = a - al
	ans_by = (a - al) * (b - by)
	print(min(ans_ax, ans_by))


def solve(a, b, x, y, n):
	if a - x > n:
		a -= n
		return a * b
	else:
		n -= a - x
		a = x
		if b - y > n:
			b -= n
			return a * b
		else:
			b = y
			return a * b
t = int(input())
for xx in range(t):
	(a, b, x, y, n) = map(int, input().split())
	wyn_a = solve(a, b, x, y, n)
	wyn_b = solve(b, a, y, x, n)
	if wyn_a < wyn_b:
		print(wyn_a)
	else:
		print(wyn_b)


from collections import *
from sys import stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]

def f(a, b, x, y, n):
	db = min(b - y, n)
	n -= db
	b -= db
	da = min(a - x, n)
	a -= da
	return a * b
for _ in range(rl()[0]):
	(a, b, x, y, n) = rl()
	print(min(f(a, b, x, y, n), f(b, a, y, x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	a2 = a
	b1 = b
	b2 = b
	x1 = x
	x2 = x
	y1 = y
	y2 = y
	v = n
	ans = min(a1 - x1, n)
	a1 = abs(a1 - ans)
	n = abs(n - ans)
	if n > 0:
		mi = min(b1 - y1, n)
		b1 = abs(b1 - mi)
	s = a1 * b1
	ans = min(b2 - y2, v)
	b2 = abs(b2 - ans)
	v = abs(v - ans)
	if v > 0:
		mi = min(a2 - x2, v)
		a2 = abs(a2 - mi)
	d = a2 * b2
	print(min(s, d))


t = int(input())
for i in range(t):
	l = list(map(int, input().split(' ')))
	a = l[0]
	b = l[1]
	x = l[2]
	y = l[3]
	n = l[4]
	if a - n < x:
		n -= a - x
		a = x
		if b - n < y:
			b = y
		else:
			b -= n
		res = a * b
	else:
		res = (a - n) * b
	a = l[0]
	b = l[1]
	x = l[2]
	y = l[3]
	n = l[4]
	if b - n < y:
		n -= b - y
		b = y
		if a - n < x:
			a = x
		else:
			a -= n
		res_2 = a * b
	else:
		res_2 = (b - n) * a
	if res > res_2:
		print(res_2)
	else:
		print(res)


t = int(input())
import copy

def calc(o, a, x, n):
	operations = min(n - o, a - x)
	a -= operations
	o += operations
	return [o, a]
for _ in range(t):
	(aa, bb, x, y, n) = list(map(int, input().split()))
	o = 0
	a = copy.copy(aa)
	b = copy.copy(bb)
	(o, a) = calc(o, a, x, n)
	if o != n:
		(o, b) = calc(o, b, y, n)
	d = a * b
	o = 0
	a = copy.copy(aa)
	b = copy.copy(bb)
	(o, b) = calc(o, b, y, n)
	if o != n:
		(o, a) = calc(o, a, x, n)
	f = a * b
	print(min(d, f))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	l = 0
	if a - x < b - y:
		(a, b) = (b, a)
		(x, y) = (y, x)
	d2 = b
	d1 = a - n
	if d1 < x:
		l = x - d1
		d1 = x
		d2 = b - l
		if d2 < y:
			d2 = y
	ans1 = d1 * d2
	d2 = a
	d1 = b - n
	if d1 < y:
		l = y - d1
		d1 = y
		d2 = a - l
		if d2 < x:
			d2 = x
	ans2 = d1 * d2
	print(min(ans1, ans2))


def solve(a, b, x, y, n):
	if a == x and b == y:
		return a * b
	if a > b:
		return solve(a=b, b=a, x=y, y=x, n=n)
	p = a + b - n
	max_a_decr = int()
	max_b_decr = int()
	a_n_decr = a - n
	a_d = x - a_n_decr
	a_unused_points = 0
	if a_d >= 0:
		a_unused_points = a_d
		max_a_decr = x
	else:
		max_a_decr = a_n_decr
	b_n_decr = b - n
	b_d = y - b_n_decr
	b_unused_points = 0
	if b_d >= 0:
		b_unused_points = b_d
		max_b_decr = y
	else:
		max_b_decr = b_n_decr
	assert (max_a_decr + (b - a_unused_points) == p, f'{max_a_decr} + ({b} - {a_unused_points}) != {p}')
	assert (max_b_decr + (a - b_unused_points) == p, f'{max_b_decr} + ({a} - {b_unused_points}) != {p}')
	if max_a_decr < max_b_decr:
		return max_a_decr * max(b - a_unused_points, y)
	return max_b_decr * max(a - b_unused_points, x)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(solve(a, b, x, y, n))


import math
t = int(input())
while t > 0:
	t -= 1
	(a, b, x, y, n) = [int(j) for j in input().split()]
	ans = a * b
	option1 = math.inf
	option2 = math.inf
	option3 = math.inf
	option4 = math.inf
	option5 = math.inf
	option6 = math.inf
	if a - n >= x:
		option1 = (a - n) * b
	else:
		temp2 = n - (a - x)
		if b - temp2 >= y:
			option3 = x * (b - temp2)
		else:
			option5 = x * y
	if b - n >= y:
		option2 = a * (b - n)
	else:
		temp2 = n - (b - y)
		if a - temp2 >= x:
			option4 = (a - temp2) * y
		else:
			option6 = x * y
	print(min(ans, option1, option2, option3, option4, option5, option6))


import sys
input = sys.stdin.readline

def solve():
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		if a - x >= n:
			s1 = (a - n) * b
		else:
			s1 = x * (b - (n - (a - x)))
		if b - y >= n:
			s2 = (b - n) * a
		else:
			s2 = y * (a - (n - (b - y)))
		print(min(s1, s2))

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


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	sub1 = a - x
	sub2 = b - y
	if sub1 + sub2 < n:
		ans1 = x * y
	if n < sub1:
		ans1 = (a - n) * b
	elif n - sub1 < sub2:
		ans1 = x * (b - (n - sub1))
	else:
		ans1 = x * y
	if n < sub2:
		ans2 = (b - n) * a
	elif n - sub2 < sub1:
		ans2 = y * (a - (n - sub2))
	else:
		ans2 = x * y
	print(min(ans1, ans2))


def p1(a, b, x, y, n):
	d = min(b - y, n)
	b -= d
	n -= d
	if n:
		d = min(a - x, n)
		n -= d
		a -= d
	return a * b
test = int(input())
for _ in range(test):
	(a, b, x, y, n) = map(int, input().split())
	pp1 = p1(a, b, x, y, n)
	pp2 = p1(b, a, y, x, n)
	print(min(pp1, pp2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ops_a = a - x
	ops_b = b - y
	p1 = min(ops_a, n)
	p2 = min(ops_b, n - p1)
	q1 = min(ops_b, n)
	q2 = min(ops_a, n - q1)
	prod1 = (a - p1) * (b - p2)
	prod2 = (a - q2) * (b - q1)
	print(min(prod1, prod2))


def minProduct(numArray):
	a = numArray[0]
	b = numArray[1]
	x = numArray[2]
	y = numArray[3]
	n = numArray[4]
	minProd = a * b
	if a + b <= x + y + n:
		a = x
		b = y
		if minProd > a * b:
			minProd = a * b
	elif a == b and a + b > x + y + n:
		if x <= y and a - x < n:
			d = a - x
			a = x
			b = b - (n - d)
			if minProd > a * b:
				minProd = a * b
		elif x <= y and a - x >= n:
			a = a - n
			if minProd > a * b:
				minProd = a * b
		elif y < x and b - y < n:
			d = b - y
			b = y
			a = a - (n - d)
			if minProd > a * b:
				minProd = a * b
		elif y < x and b - y >= n:
			b = b - n
			if minProd > a * b:
				minProd = a * b
	elif a > b and b - y >= n:
		b = b - n
		if minProd > a * b:
			minProd = a * b
	elif a < b and a - x >= n:
		a = a - n
		if minProd > a * b:
			minProd = a * b
	elif a > b and a - x >= n:
		d = b - y
		temp1 = y
		temp2 = a - (n - d)
		if minProd > temp1 * temp2:
			minProd = temp1 * temp2
		a = a - n
		if minProd > a * b:
			minProd = a * b
	elif a > b and a - x < n:
		e = a - x
		temp1 = x
		temp2 = b - (n - e)
		if minProd > temp1 * temp2:
			minProd = temp1 * temp2
		f = b - y
		b = y
		a = a - (n - f)
		if minProd > a * b:
			minProd = a * b
	elif a < b and b - y >= n:
		d = a - x
		temp1 = x
		temp2 = b - (n - d)
		if minProd > temp1 * temp2:
			minProd = temp1 * temp2
		b = b - n
		if minProd > a * b:
			minProd = a * b
	elif a < b and b - y < n:
		e = b - y
		temp1 = y
		temp2 = a - (n - e)
		if minProd > temp1 * temp2:
			minProd = temp1 * temp2
		f = a - x
		a = x
		b = b - (n - f)
		if minProd > a * b:
			minProd = a * b
	return minProd
num = int(input())
for i in range(num):
	m = []
	m = list(map(int, input().strip().split()))[:5]
	z = minProduct(m)
	print(z)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	diffa = min(a - x, n)
	diffb = min(b - y, n)
	if a - diffa <= b - diffb:
		a -= diffa
		n -= diffa
		b -= min(b - y, n)
	elif a - diffa > b - diffb:
		b -= diffb
		n -= diffb
		a -= min(a - x, n)
	print(a * b)


import sys

def get_first(a, b, x, y, n):
	d = min(n, a - x)
	a -= d
	n -= d
	d = min(n, b - y)
	b -= d
	n -= d
	return a * b

def get_second(a, b, x, y, n):
	d = min(n, b - y)
	b -= d
	n -= d
	d = min(n, a - x)
	a -= d
	n -= d
	return a * b
t = int(sys.stdin.readline())
for _ in range(t):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split())
	print(min(get_first(a, b, x, y, n), get_second(a, b, x, y, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	dif1 = a - x
	dif2 = b - y
	if dif1 + dif2 < n:
		print(x * y)
	else:
		ans = 10 ** 100
		if dif1 < n:
			if b - n + dif1 >= y:
				ans = min(ans, x * (b - n + dif1))
			else:
				ans = min(ans, x * y)
		else:
			ans = min(ans, (a - n) * b)
		if dif2 < n:
			if a - n + dif2 >= x:
				ans = min(ans, y * (a - n + dif2))
			else:
				ans = min(ans, x * y)
		else:
			ans = min(ans, (b - n) * a)
		print(ans)


t = int(input(''))

def ok(a, b, x, y, n):
	d1 = a - x
	d2 = b - y
	c1 = min(d1, n)
	a -= c1
	n -= c1
	c2 = min(d2, n)
	b -= c2
	n -= c2
	ans = a * b
	return ans
for _ in range(t):
	(a, b, x, y, n) = map(int, input('').split())
	ans = min(ok(a, b, x, y, n), ok(b, a, y, x, n))
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(o1, o2) = (a, a)
	(t1, t2) = (b, b)
	o1 = a - min(n, a - x)
	n1 = n - min(n, a - x)
	if n1 > 0:
		t1 = b - min(n1, b - y)
		n1 = n1 - min(n1, b - y)
	t2 = b - min(n, b - y)
	n2 = n - min(n, b - y)
	if n2 > 0:
		o2 = a - min(n2, a - x)
		n2 = n - min(n2, a - x)
	print(min(o1 * t1, o2 * t2))


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c1 = a
	d = b
	n1 = n
	mini = 0
	if min(a, b) == b:
		c = min(b - y, n)
		n -= c
		b -= c
		c = min(a - x, n)
		n -= c
		a -= c
		mini = a * b
		c = min(c1 - x, n1)
		n1 -= c
		c1 -= c
		c = min(d - y, n1)
		n1 -= c
		d -= c
		mini = min(mini, c1 * d)
	else:
		c = min(a - x, n)
		n -= c
		a -= c
		c = min(b - y, n)
		n -= c
		b -= c
		mini = a * b
		c = min(d - y, n1)
		n1 -= c
		d -= c
		c = min(c1 - x, n1)
		n1 -= c
		c1 -= c
		c = min(b - y, n1)
		n1 -= c
		d -= c
		mini = min(mini, c1 * d)
	print(mini)


from sys import stdin, stdout

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

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

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

def gars():
	return list(map(str, stdin.readline().strip().split()))

def gs():
	return stdin.readline().strip()

def gls():
	return list(stdin.readline())

def gi():
	return int(stdin.readline().strip())
t = gi()
while t:
	t -= 1
	(a, b, x, y, n) = gmi()
	A = a
	B = b
	if a - n >= x:
		a = a - n
	else:
		a = x
		b = b - (n - (A - x))
	if a < x:
		a = x
	if b < y:
		b = y
	z = a * b
	a = A
	b = B
	if b - n >= y:
		b = b - n
	else:
		b = y
		a = a - (n - (B - y))
	if a < x:
		a = x
	if b < y:
		b = y
	z1 = a * b
	print(min(z, z1))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(delta1, delta2) = (a - x, b - y)
	if n >= delta1 + delta2:
		print(x * y)
	else:
		ans = []
		if n >= delta1:
			ans.append(x * (b - (n - delta1)))
		if n < delta1:
			ans.append((a - n) * b)
		if n >= delta2:
			ans.append(y * (a - (n - delta2)))
		if n < delta2:
			ans.append((b - n) * a)
		print(min(ans))


def solve(a, b, x, y, n):
	asum = min(n, a - x)
	a -= asum
	n -= asum
	bsum = min(n, b - y)
	b -= bsum
	return a * b
t_case = int(input())
for _ in range(t_case):
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))


def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = map(int, input().split())
		p = a - x
		q = b - y
		ans = pow(10, 18)
		if p + q <= n:
			ans = min(ans, x * y)
		else:
			tmp = n
			a_tmp = a
			b_tmp = b
			if p <= n:
				n -= p
				a -= p
			else:
				a -= n
				n = 0
			b -= n
			ans = min(ans, a * b)
			if q <= tmp:
				tmp -= q
				b_tmp -= q
			else:
				b_tmp -= tmp
				tmp = 0
			a_tmp -= tmp
			ans = min(ans, a_tmp * b_tmp)
		print(ans)
main()


for _ in range(int(input())):
	(a, b, x, y, k) = [int(x) for x in input().split()]
	a1 = a2 = a
	b1 = b2 = b
	k1 = k2 = k
	if a1 - x >= k1:
		a1 -= k1
	else:
		k1 -= a1 - x
		a1 = x
		if b1 - y >= k1:
			b1 -= k1
		else:
			b1 = y
	if b2 - y >= k2:
		b2 -= k2
	else:
		k2 -= b2 - y
		b2 = y
		if a2 - x >= k2:
			a2 -= k2
		else:
			a2 = x
	print(min(a1 * b1, a2 * b2))


i = int(input())
for _ in range(i):
	(a, b, x, y, n) = map(int, input().split())
	x1 = a - x
	x1 = x1 if x1 < n else n
	y1 = b - y
	y1 = y1 if y1 < n else n
	k1 = a - x1
	k2 = b - y1
	if k2 < k1:
		b = k2
		n -= y1
		if n > 0:
			a -= n if n < x1 else x1
	else:
		a = k1
		n -= x1
		if n > 0:
			b -= n if n < y1 else y1
	print(b * a)


def min_product(a, b, x, y, n):
	if n > a - x:
		n -= a - x
		a = x
		if n > b - y:
			b = y
		else:
			b -= n
	else:
		a -= n
	return a * b
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(min_product(a, b, x, y, n), min_product(b, a, y, x, n)))


def minProduct(a, b, x, y, n):
	(p, q) = (a, b)
	m = n
	if a - x >= n:
		a = a - n
		n = 0
	else:
		n -= a - x
		a = x
	if b - y >= n:
		b = b - n
		n = 0
	else:
		n -= b - y
		b = y
	if q - y >= m:
		q = q - m
		m = 0
	else:
		m -= q - y
		q = y
	if p - x >= m:
		p = p - m
		m = 0
	else:
		m -= p - x
		p = x
	return min(a * b, p * q)
t = int(input())
final = []
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	final.append(minProduct(a, b, x, y, n))
for _ in range(t):
	print(final[_])


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	minimum = 100000000000000000000000000000000
	if a - x >= n:
		minimum = min(minimum, (a - n) * b)
	if b - y >= n:
		minimum = min(minimum, (b - n) * a)
	temp1 = a
	temp2 = b
	tempn = n
	val = min(temp1 - x, tempn)
	temp1 -= val
	tempn -= val
	temp2 -= min(temp2 - y, tempn)
	minimum = min(minimum, temp1 * temp2)
	val2 = min(b - y, n)
	b -= val2
	n -= val2
	a -= min(a - x, n)
	minimum = min(minimum, a * b)
	print(minimum)


for _ in range(int(input())):

	def ans1(a, b, x, y, n):
		a1 = min(a - x, n)
		a -= a1
		if a1 < n:
			b1 = min(b - y, n - a1)
			b -= b1
		return a * b

	def ans2(a, b, x, y, n):
		b1 = min(b - y, n)
		b -= b1
		if b1 < n:
			a1 = min(a - x, n - b1)
			a -= a1
		return a * b
	(a, b, x, y, n) = [int(x) for x in input().split()]
	print(min(ans1(a, b, x, y, n), ans2(a, b, x, y, n)))


tmp = int(input())

def solve(a, b, x, y, n):
	if a - x < n:
		n -= a - x
		a = a - (a - x)
		if b - y < n:
			b = b - (b - y)
		else:
			b -= n
	else:
		a -= n
	return a * b

def solve2(a, b, x, y, n):
	if b - y < n:
		n -= b - y
		b = b - (b - y)
		if a - x < n:
			a = a - (a - x)
		else:
			a -= n
	else:
		b -= n
	return a * b
for i in range(tmp):
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve2(a, b, x, y, n)))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	k = abs(a - b)
	k1 = abs(a - x)
	k2 = abs(b - y)
	if n > k1 + k2:
		n = k1 + k2
	d = 0
	e = 0
	if n <= min(k1, k2):
		ans = min((a - n) * b, (b - n) * a)
	elif n > min(k1, k2) and n < max(k1, k2):
		if k1 <= k2:
			d = k1
			e = n - k1
			ans = min((a - d) * (b - e), a * (b - n))
		else:
			e = k2
			d = n - k2
			ans = min((a - d) * (b - e), b * (a - n))
	elif n <= k1 + k2:
		ans = min((a - k1) * (b - (n - k1)), (a - (n - k2)) * (b - k2))
	print(ans)


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
while t > 0:
	t -= 1
	(a, b, x, y, n) = mi()
	p = min(n, a - x)
	q = min(b - y, n)
	if a - p <= b - q and p <= n:
		a -= p
		n -= p
	elif a - p > b - q and q <= n:
		b -= q
		n -= q
	p = min(n, a - x)
	a -= p
	n -= p
	q = min(n, b - y)
	b -= q
	n -= q
	print(a * b)


import sys, math
input = sys.stdin.readline
t = int(input())

def f(a, b, x, y, n):
	diff = a - x
	if diff < n:
		a -= diff
		diff2 = b - y
		b -= min(diff2, n - diff)
	else:
		a -= n
	return a * b
for r in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	ans = min(f(a, b, x, y, n), f(b, a, y, x, n))
	print(ans)


for s in [*open(0)][1:]:
	(a, b, x, y, n) = map(int, s.split())
	if n > a - x + b - y:
		n = a - x + b - y
	l = max(n - (b - y), 0)
	h = min(a - x, n)
	min1 = a * b - a * n + ((a - b + n) * l - l * l)
	min2 = a * b - a * n + ((a - b + n) * h - h * h)
	print(min(min1, min2))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	save = [a, b, x, y, n]
	(a, b, x, y) = (b, a, y, x)
	if b - n >= y:
		b -= n
	else:
		n -= b - y
		b = y
		a = max(a - n, x)
	ans = b * a
	(a, b, x, y, n) = save
	if b - n >= y:
		b -= n
	else:
		n -= b - y
		b = y
		a = max(a - n, x)
	ans = min(ans, b * a)
	print(ans)


import sys
r = sys.stdin.readline
t = int(r())
for _ in range(t):
	(a, b, x, y, n) = map(int, r().split())
	N1 = n - (b - max(b - n, y))
	b1 = max(b - n, y)
	a1 = max(a - N1, x)
	N2 = n - (a - max(a - n, x))
	a2 = max(a - n, x)
	b2 = max(b - N2, y)
	print(min(a1 * b1, a2 * b2))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	c = abs(a - x)
	d = abs(b - y)
	l = 0
	m = 0
	(L, M) = (0, 0)
	p = min(a, b)
	q = max(a, b)
	if a == b:
		if c > d:
			a -= min(n, c)
			n -= min(n, c)
			l = 1
		else:
			b -= min(n, d)
			n -= min(n, d)
			m = 1
	elif a - min(n, c) <= b - min(d, n):
		a -= min(n, c)
		n -= min(n, c)
		l = 1
	elif a - min(n, c) > b - min(d, n):
		b -= min(n, d)
		n -= min(n, d)
		m = 1
	if n > 0:
		if l == 1:
			b -= min(n, d)
		elif m == 1:
			a -= min(n, c)
	print(int(b * a))


t = int(input().strip())
for i in range(t):
	(a, b, x, y, n) = tuple(map(int, input().strip().split(' ')))
	d1 = a - x
	d2 = b - y
	if d1 + d2 <= n:
		res = x * y
	else:
		m1 = min(n, d1)
		res1 = (a - m1) * (b - (n - m1))
		m2 = min(n, d2)
		res2 = (b - m2) * (a - (n - m2))
		res = min(res1, res2)
	print(res)


T = int(input())
for t in range(T):
	(a, b, x, y, n) = map(int, input().split())
	if max(x, a - n) > max(y, b - n):
		p1 = max(y, b - n)
		if p1 == y:
			red = b - y
			n -= red
			b = p1
			a = max(x, a - n)
		else:
			b = b - n
	else:
		p1 = max(x, a - n)
		if p1 == x:
			red = a - x
			n -= red
			a = p1
			b = max(y, b - n)
		else:
			a = a - n
	print(a * b)


t = int(input())
while t:
	t = t - 1
	(a, b, x, y, n) = map(int, input().split())
	if max(a - n, x) >= max(b - n, y):
		if b - n >= y:
			print((b - n) * a)
		elif a + b - n - y >= x:
			print(y * (a + b - n - y))
		else:
			print(x * y)
	elif a - n >= x:
		print((a - n) * b)
	elif a + b - n - x >= y:
		print(x * (a + b - n - x))
	else:
		print(x * y)


t = int(input(''))
arr = []
for i in range(t):
	arr.append(list(map(int, input().split())))
for i in arr:
	a = i[0]
	b = i[1]
	x = i[2]
	y = i[3]
	n = i[4]
	dx = a - x
	dy = b - y
	a1 = a
	b1 = b
	n1 = n
	if dx <= n:
		a1 = x
		n1 -= dx
	else:
		a1 -= n
		n1 = 0
	if n1:
		if b - n1 >= y:
			b1 -= n1
		else:
			b1 = y
	sol = a1 * b1
	if dy <= n:
		b = y
		n -= dy
	else:
		b -= n
		n = 0
	if n:
		if a - n >= x:
			a -= n
		else:
			a = x
	print(min(sol, a * b))


import sys
input = lambda : sys.stdin.readline().rstrip()
from collections import deque
from queue import LifoQueue
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a < b:
		temp = a
		a = b
		b = temp
		temp = x
		x = y
		y = temp
	p1 = min(a - x, n)
	p2 = min(b - y, n)
	if min(n - p2, a - x) * b + p2 * a - min(n - p2, a - x) * p2 >= p1 * b + min(n - p1, b - y) * a - min(n - p1, b - y) * p1:
		if p2 == n:
			print(a * b - p2 * a)
		else:
			print((a - min(n - p2, a - x)) * (b - p2))
	elif p1 == n:
		print(a * b - p1 * b)
	else:
		print((a - p1) * (b - min(n - p1, b - y)))


import math
for _ in range(int(input())):
	(a, b, x, y, n) = [int(j) for j in input().split()]
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	(a2, b2, n2) = (a, b, n)
	a1 = a - min(n, a - x)
	n = n - (a - a1)
	a = a1
	b = b - min(n, b - y)
	b3 = b2 - min(n2, b2 - y)
	n2 = n2 - (b2 - b3)
	b2 = b3
	a2 = a2 - min(n2, a2 - x)
	print(min(a2 * b2, a * b))


t = int(input())
output = []
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	products = []
	if a - n >= x:
		products.append((a - n) * b)
	if b - n >= y:
		products.append((b - n) * a)
	q = n // 2
	if a - q >= x and b - (n - q) >= y:
		products.append((a - q) * (b - (n - q)))
	if a - (n - q) >= x and b - q >= y:
		products.append((a - (n - q)) * (b - q))
	if n == a - x + (b - y):
		products.append(x * y)
	if n >= a - x:
		temp_n = n - (a - x)
		if temp_n >= b - y:
			products.append(x * y)
		else:
			products.append(x * (b - temp_n))
	if n >= b - y:
		temp_n = n - (b - y)
		if temp_n >= a - x:
			products.append(y * x)
		else:
			products.append(y * (a - temp_n))
	output.append(min(products))
for i in output:
	print(i)


def solve():

	def cal(na):
		nb = max(y, b - (n - (a - na)))
		return na * nb
	(a, b, x, y, n) = map(int, input().split())
	na = max(x, a - n)
	nb = max(y, b - (n - (a - na)))
	ans = na * nb
	nb = max(y, b - n)
	na = max(x, a - (n - (b - nb)))
	ans = min(na * nb, ans)
	print(ans)
T = int(input())
for _ in range(T):
	solve()


def getMinProd(a1, a2, b1, b2, n):
	val = 0
	if a1 - a2 >= n:
		a1 -= n
	else:
		n -= a1 - a2
		a1 = a2
		if b1 - b2 >= n:
			b1 -= n
		else:
			b1 = b2
	val = a1 * b1
	return val
t = int(input())
for i in range(t):
	(a1, b1, a2, b2, n) = tuple(map(int, input().split()))
	val1 = getMinProd(a1, a2, b1, b2, n)
	val2 = getMinProd(b1, b2, a1, a2, n)
	print(min(val1, val2))


def main():
	t = int(input())
	for i in range(t):
		(a, b, x, y, n) = map(int, input().split())
		result = find_min_product(a, b, min_a=x, min_b=y, operations_n=n)
		print(result)

def find_min_product(a, b, min_a, min_b, operations_n, do_repeat=True):
	assert a >= min_a
	assert b >= min_b
	delta_a = a - min_a
	delta_b = b - min_b
	if operations_n >= delta_a + delta_b:
		return min_a * min_b
	if do_repeat:
		alternative_result = find_min_product(b, a, min_b, min_a, operations_n, do_repeat=False)
	if operations_n <= delta_a:
		result = (a - operations_n) * b
	else:
		a = min_a
		operations_n -= delta_a
		b -= operations_n
		b = max(b, min_b)
		result = a * b
	if not do_repeat:
		return result
	return min(result, alternative_result)
main()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a2 = max(a - n, x)
	b2 = max(b - (n - (a - a2)), y)
	b3 = max(b - n, y)
	a3 = max(a - (n - (b - b3)), x)
	print(min(a2 * b2, a3 * b3))


def reduc(a, x, n):
	t = min(a - x, n)
	ex = n - t
	a -= t
	return (a, ex)

def reducmain(a, b, x, y, n):
	i = 0
	(ta, tb, tx, ty) = (a, b, x, y)
	case1 = inf
	while i < 2:
		(ta, ex) = reduc(ta, tx, n)
		(tb, _) = reduc(tb, ty, ex)
		case1 = min(case1, ta * tb)
		(ta, tb, tx, ty) = (b, a, y, x)
		i += 1
	return case1
from math import inf
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = inf
	ans = min(ans, reducmain(a, b, x, y, n))
	print(ans)


for i in range(int(input())):
	(b, c, d, e, f) = map(int, input().split())
	l = b - f
	if l < d:
		k = c - (d - l)
		l = d
		if k < e:
			k = e
	else:
		k = c
	t = l * k
	l = k = 0
	l = c - f
	if l < e:
		k = b - (e - l)
		l = e
		if k < d:
			k = d
	else:
		k = b
	m = l * k
	print(min(t, m))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(t1, t2) = (a, b)
	ans = float('inf')
	a1 = a - x
	b1 = b - y
	temp = n
	a -= min(n, a1)
	n -= min(n, a1)
	b -= min(n, b1)
	ans = min(ans, a * b)
	t2 -= min(temp, b1)
	temp -= min(temp, b1)
	t1 -= min(temp, a1)
	ans = min(ans, t1 * t2)
	print(ans)


import math

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

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

def solution(a, b, x, y, n):
	m = min(n, a - x)
	a -= m
	n -= m
	m = min(n, b - y)
	b -= m
	return a * b
t = inp()
result = []
while t:
	t -= 1
	(a, b, x, y, n) = inlt()
	result.append(min(solution(a, b, x, y, n), solution(b, a, y, x, n)))
for r in result:
	print(r)


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	p = min(a - x, n)
	q = min(b - y, n)
	r1 = min(n - q, p)
	r2 = min(n - p, q)
	m1 = (a - r1) * (b - q)
	m2 = (a - p) * (b - r2)
	ans = min(m1, m2)
	print(ans)


def p(a, b, x, y, n):
	if a - x <= n:
		n -= a - x
		a = x
		if b - y <= n:
			b = y
		else:
			b = b - n
		return a * b
	else:
		a = a - n
		return a * b
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = p(a, b, x, y, n)
	ans2 = p(b, a, y, x, n)
	print(min(ans1, ans2))


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	b1 = max(y, b - n)
	l1 = n - b + b1
	a1 = max(x, a - l1)
	a2 = max(x, a - n)
	l2 = n - a + a2
	b2 = max(y, b - l2)
	print(min(a1 * b1, a2 * b2))


def read(datatype=int):
	return datatype(input())

def readl(datatype=int):
	return list(map(datatype, input().split()))

def printl(data):
	string = ''
	for d in data:
		string += str(d) + ' '
	print(string)

def testcase():
	(a, b, x, y, n) = readl()
	new_a = max(x, a - n)
	diff_a = a - new_a
	new_b = max(y, b - (n - diff_a))
	ans_one = new_a * new_b
	new_b = max(y, b - n)
	diff_b = b - new_b
	new_a = max(x, a - (n - diff_b))
	ans_two = new_a * new_b
	ans = min(ans_one, ans_two)
	print(ans)
	return
t = read()
for _ in range(t):
	testcase()


import math
for t in range(int(input())):
	ma = 10000000000000000000000000000000000000000000
	(a, b, x, y, n) = map(int, input().split())
	if a + b - x - y <= n:
		ma = min(ma, x * y)
	elif a < b:
		if n > a - x:
			ma = min(ma, x * (b - n + a - x))
		else:
			ma = min(ma, (a - n) * b)
		if n > b - y:
			ma = min(ma, y * (a - n + b - y))
		else:
			ma = min(ma, (b - n) * a)
	else:
		if n > b - y:
			ma = min(ma, y * (a - n + b - y))
		else:
			ma = min(ma, (b - n) * a)
		if n > a - x:
			ma = min(ma, x * (b - n + a - x))
		else:
			ma = min(ma, (a - n) * b)
	print(ma)


t = int(input())
while t > 0:
	(aa, bb, x, y, nn) = [int(i) for i in input().split()]
	if aa < bb:
		(x, y) = (y, x)
	a = max(aa, bb)
	b = min(aa, bb)
	(aa, bb, n) = (a, b, nn)
	b = max(y, bb - n)
	n -= min(n, bb - y)
	a = max(x, aa - n)
	n -= min(n, aa - x)
	ans = a * b
	n = nn
	a = max(x, aa - n)
	n -= min(n, aa - x)
	b = max(y, bb - n)
	n -= min(n, bb - y)
	ans = min(ans, a * b)
	print(ans)
	t -= 1


t = int(input())
while t > 0:
	t -= 1
	(a, b, x, y, n) = map(int, input().strip().split(' '))
	g = n
	da = a - x
	db = b - y
	na = a - min(n, da)
	g = n - min(n, da)
	nb = b - min(g, db)
	nbb = b - min(n, db)
	n -= min(n, db)
	naa = a - min(n, da)
	p1 = na * nb
	p2 = (a - min(n // 2, da)) * (b - min(n - n // 2, db))
	p3 = naa * nbb
	print(min(p1, p2, p3))


def solve(a, b, x, y, n):
	temp_a = a
	temp_b = b
	temp_n = n
	temp = b
	b -= min(b - y, n)
	n -= min(temp - y, n)
	a -= min(a - x, n)
	temp_ans1 = a * b
	temp2 = temp_a
	temp_a -= min(temp_a - x, temp_n)
	temp_n -= min(temp2 - x, temp_n)
	temp_b -= min(temp_b - y, temp_n)
	return min(temp_ans1, temp_a * temp_b)
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(solve(a, b, x, y, n))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().strip().split()))
	move1 = a - x
	move2 = b - y
	if move1 >= n:
		ans1 = (a - n) * b
	elif move2 >= n - move1:
		ans1 = x * (b - (n - move1))
	else:
		ans1 = x * y
	if move2 >= n:
		ans2 = a * (b - n)
	elif move1 >= n - move2:
		ans2 = (a - (n - move2)) * y
	else:
		ans2 = x * y
	print(min(ans1, ans2))


t = int(input(''))
for i in range(0, t):
	(a, b, x, y, n) = input('').split(' ')
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	p = a - x
	q = b - y
	s = a * b
	if n >= p + q:
		s = x * y
	elif n >= p and n <= q:
		s = min(x * (b - n + p), (b - n) * a)
	elif n >= q and n <= p:
		s = min(y * (a - n + q), (a - n) * b)
	elif n > p and n > q:
		if x > y:
			s = y * (a - n + q)
		else:
			s = x * (b - n + p)
	elif n < p and n < q:
		s = min((a - n) * b, (b - n) * a)
	print(s)


from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ax = a - x
	by = b - y
	aa = a
	bb = b
	nn = n
	r = min(n, by)
	b -= r
	n -= r
	r = min(n, ax)
	a -= r
	r = min(nn, ax)
	aa -= r
	nn -= r
	r = min(nn, by)
	bb -= r
	stdout.write(str(min(a * b, aa * bb)) + '\n')


import math
import os
import random
import re
import sys
from collections import defaultdict, Counter, deque
import heapq
from functools import lru_cache
from itertools import accumulate, chain, combinations, permutations, groupby, zip_longest
from math import floor, ceil, sqrt
t = int(input())
res = []

def f(a, b, x, y, n):
	d = a - x
	a -= min(d, n)
	n -= min(d, n)
	b -= min(b - y, n)
	return a * b
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	res += (min(f(a, b, x, y, n), f(b, a, y, x, n)),)
for v in res:
	print(v)


def fun(a, b, x, y, n):
	if a - x <= n:
		n -= a - x
		a = x
	else:
		a -= n
		n = 0
	if b - y <= n:
		n -= b - y
		b = y
	else:
		b -= n
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(fun(a, b, x, y, n), fun(b, a, y, x, n)))


import math

def arraysum(array1, array2):
	allsum = 0
	for i in range(len(array1)):
		allsum += abs(array1[i] - array2[i])
m = int(input())
for i in range(m):
	s = input().split(' ')
	a = int(s[0])
	b = int(s[1])
	c = int(s[2])
	d = int(s[3])
	n = int(s[4])
	a1 = a - c
	b1 = b - d
	aa1 = a1
	bb1 = b1
	q1 = 0
	q2 = 0
	aa = a
	bb = b
	cc = c
	dd = d
	nn = n
	a -= min(a1, n)
	n -= min(a1, n)
	b -= min(b1, n)
	n -= min(b1, n)
	q1 = a * b
	bb -= min(bb1, nn)
	nn -= min(bb1, nn)
	aa -= min(aa1, nn)
	nn -= min(aa1, nn)
	q2 = aa * bb
	print(min(q1, q2))


test_cases = int(input())
for test_case in range(test_cases):
	(a, b, x, y, n) = list(map(int, input().split()))
	diffa = a - x
	diffb = b - y
	minab = min(a, b)
	amin = max(a - n, x)
	bmin = max(b - n, y)
	if bmin < amin:
		if n > 0:
			if n >= b - y:
				n -= b - y
				b -= b - y
			else:
				b -= n
				n = 0
		if n > 0:
			if n >= a - x:
				n -= a - x
				a -= a - x
			else:
				a -= n
				n = 0
	else:
		if n > 0:
			if n >= a - x:
				n -= a - x
				a -= a - x
			else:
				a -= n
				n = 0
		if n > 0:
			if n >= b - y:
				n -= b - y
				b -= b - y
			else:
				b -= n
				n = 0
	print(a * b)


def solve(a, b, x, y, n):
	if a - x + (b - y) <= n:
		return x * y
	else:

		def f(x):
			return (a - x) * (b - (n - x))
		opt = (n + a - b) // 2
		ans = min(f(max(0, n - (b - y))), f(min(n, a - x)))
		for err in range(-5, 5 + 1):
			tA = opt + err
			tB = n - tA
			if tA >= 0 and tB >= 0 and (a - tA >= x) and (b - tB >= y):
				ans = min(ans, f(tA))
		return ans
for _ in range(int(input())):
	print(solve(*map(int, input().split())))


t = int(input())

def compute(p, q, x, y, n):
	if p <= x:
		pass
	elif p - n >= x:
		p -= n
		n = 0
	else:
		subtract = min(p - x, n)
		p -= subtract
		n = n - subtract
	if q <= y:
		pass
	elif q - n >= y:
		q -= n
		n = 0
	else:
		subtract = min(q - y, n)
		q -= subtract
		n -= subtract
	return p * q
for _ in range(t):
	(a, b, x, y, n) = map(int, input().strip().split())
	print(min(compute(a, b, x, y, n), compute(b, a, y, x, n)))


import bisect
import collections
import functools
import itertools
import math
import heapq
import random
import string

def repeat(_func=None, *, times=1):

	def decorator(func):

		@functools.wraps(func)
		def wrapper(*args, **kwargs):
			for _ in range(times):
				func(*args, **kwargs)
		return wrapper
	if _func is None:
		return decorator
	else:
		return decorator(_func)

def unpack(func=int):
	return map(func, input().split())

def l_unpack(func=int):
	return list(map(func, input().split()))

def getint():
	return int(input())

def getmatrix(rows):
	return [list(map(int, input().split())) for _ in range(rows)]

def display_matrix(mat):
	for i in range(len(mat)):
		print(mat[i])

@repeat(times=int(input()))
def main():
	(a, b, x, y, n) = unpack()

	def util(a, b, x, y, n):
		if a - x >= n:
			a -= n
			n = 0
		else:
			n -= a - x
			a = x
		if b - y >= n:
			b -= n
			n = 0
		else:
			n -= b - y
			b = y
		return a * b
	ans = min(util(a, b, x, y, n), util(b, a, y, x, n))
	print(ans)
MOD = 10 ** 9 + 7
main()


for _ in range(int(input())):
	(t, k, x, y, n1) = map(int, input().split())
	(a, b, n) = (t, k, n1)
	if n > a - x:
		n -= a - x
		a = x
	elif n <= a - x:
		a -= n
		n = 0
	if n > b - y:
		n -= b - y
		b = y
	elif n <= b - y:
		b -= n
	t1 = a * b
	(a, b, n) = (t, k, n1)
	if n > b - y:
		n -= b - y
		b = y
	elif n <= b - y:
		b -= n
		n = 0
	if n > a - x:
		n -= a - x
		a = x
	elif n <= a - x:
		a -= n
		n = 0
	print(min(t1, a * b))


from math import gcd
from collections import defaultdict
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	i = min(a - x, n)
	q = a - i
	nl = n - i
	j = min(b - y, nl)
	qq = b - j
	z = q * qq
	i = min(b - y, n)
	q = b - i
	nl = n - i
	j = min(a - x, nl)
	qq = a - j
	zz = q * qq
	print(min(z, zz))


import math as m

def solve() -> int:
	(a, b, x, y, n) = [int(x) for x in input().split()]
	if n >= a - x + (b - y):
		return x * y
	else:
		return min((a - min(n, a - x)) * (b - (n - min(n, a - x))), (b - min(n, b - y)) * (a - (n - min(n, b - y))), (a - min(m.ceil(n / 2), a - x)) * (b - min(m.floor(n / 2), b - y)), (a - min(m.floor(n / 2), a - x)) * (b - min(m.ceil(n / 2), b - y)))
t = int(input())
for i in range(t):
	print(solve())


def calc(a, b, x, y, n):
	t = min(a - x, n)
	a -= t
	n -= t
	t = min(b - y, n)
	b -= t
	return a * b
t = int(input())
for x in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	c = min(calc(a, b, x, y, n), calc(b, a, y, x, n))
	print(c)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if x < y:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a - x + b - y <= n:
		print(x * y)
	else:
		absum = a + b - n
		amin = max(a - n, x)
		bmin = max(b - n, y)
		abmin = min(amin, bmin)
		ans = (absum - abmin) * abmin
		print(ans)


def readstr():
	return list(map(int, input().split()))
cases = readstr()[0]

def transform(a, b, x, y, n):
	ma = max(a - n, x)
	mb = max(b - n, y)
	if ma < mb:
		rem = n - (a - ma)
		return ma * max(b - rem, y)
	else:
		rem = n - (b - mb)
		return max(a - rem, x) * mb
output = []
for _ in range(int(cases)):
	(a, b, x, y, n) = readstr()
	output.append(transform(a, b, x, y, n))
print('\n'.join(map(str, output)))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	mi = min(a, b)
	if a == b:
		mi_bound = min(x, y)
	else:
		mi_bound = x if a < b else y
	ma = a + b - mi
	ma_bound = x + y - mi_bound
	ans1 = ans2 = ans3 = ans4 = 10 ** 19
	if mi - mi_bound >= n:
		ans1 = (mi - n) * ma
	else:
		right = mi_bound
		n_curr = n - (mi - mi_bound)
		left = ma - n_curr if ma - n_curr >= ma_bound else ma_bound
		ans2 = right * left
		if ma - ma_bound >= n:
			ans3 = (ma - n) * mi
		else:
			right = ma_bound
			left = mi - (n - (ma - ma_bound)) if mi - (n - (ma - ma_bound)) >= mi_bound else mi_bound
			ans4 = right * left
	print(min(ans1, ans2, ans3, ans4))


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = map(int, input().split())
	ans_1 = 1
	ans_2 = 1
	m = n
	ans_1 *= a - min(a - x, n)
	n -= min(a - x, n)
	ans_1 *= b - min(b - y, n)
	ans_2 *= b - min(b - y, m)
	m -= min(b - y, m)
	ans_2 *= a - min(a - x, m)
	print(min(ans_1, ans_2))


import sys

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

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

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(a, b, x, y, n) = get_ints()
	rem = a - x
	z = min(n, rem)
	a1 = a - z
	n1 = n - z
	rem = b - y
	z = min(n1, rem)
	b1 = b - z
	ans1 = a1 * b1
	(a1, b1) = (a, b)
	rem = b - y
	z = min(n, rem)
	b1 = b1 - z
	n1 = n - z
	rem = a - x
	z = min(n1, rem)
	a1 = a1 - z
	ans2 = a1 * b1
	print(min(ans1, ans2))


t = int(input())
while t > 0:
	(a, b, x, y, n) = map(int, input().split(' '))
	p = float('inf')
	for i in range(2):
		d1 = min(n, a - x)
		d2 = min(n - d1, b - y)
		p = min(p, (a - d1) * (b - d2))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(p)
	t -= 1


def ans(a, b, x, y, n):
	c = min(a - x, n)
	a -= c
	n -= c
	c = min(b - y, n)
	b -= c
	return a * b
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	an = min(ans(a, b, x, y, n), ans(b, a, y, x, n))
	print(an)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	abstraction = min(n, a - x)
	ans1 = (a - abstraction) * (b - min(b - y, n - abstraction))
	abstraction = min(n, b - y)
	ans2 = (b - abstraction) * (a - min(a - x, n - abstraction))
	print(min(ans1, ans2))


t = int(input())

def minA(a, b, x, y, n):
	ax = a - x
	by = b - y
	if n <= ax:
		a -= n
		n = 0
	else:
		a -= ax
		n -= ax
	if n <= by:
		b -= n
	else:
		b -= by
	return a * b

def minB(a, b, x, y, n):
	ax = a - x
	by = b - y
	if n <= by:
		b -= n
		n = 0
	else:
		b -= by
		n -= by
	if n <= ax:
		a -= n
	else:
		a -= ax
	return a * b
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	f = minA(a, b, x, y, n)
	s = minB(a, b, x, y, n)
	print(f if f < s else s)


import sys
import math
import heapq
import collections

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

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

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

def inputstring():
	return [x for x in input()]

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

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

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	(a, b, x, y, n) = inputnums()
	c = 0
	d = 0
	if a - n >= x:
		c = b * (a - n)
	else:
		N = n - (a - x)
		B = max(y, b - N)
		c = x * B
	if b - n >= y:
		d = a * (b - n)
	else:
		N = n - (b - y)
		A = max(x, a - N)
		d = y * A
	print(min(c, d))


t = int(input().split()[0])

def solve(a, b, x, y, n):
	da = min(n, a - x)
	a -= da
	n -= da
	b = max(y, b - n)
	return a * b
for i in range(t):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	sol1 = solve(a, b, x, y, n)
	sol2 = solve(b, a, y, x, n)
	print(min(sol1, sol2))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, n1) = (a, b, n)
	temp = min(b - y, n)
	b -= temp
	n -= temp
	temp = min(a - x, n)
	a -= temp
	ans = a * b
	temp = min(a1 - x, n1)
	a1 -= temp
	n1 -= temp
	temp = min(b1 - y, n1)
	b1 -= temp
	print(min(ans, a1 * b1))


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


def solve(a, b, x, y, n):
	if a - x + (b - y) <= n:
		return x * y
	(bb, aa, yy, xx, nn) = (a, b, x, y, n)
	minus = min(a - x, n)
	a -= minus
	n -= minus
	b -= min(b - y, n)
	ans1 = a * b
	minus = min(aa - xx, nn)
	aa -= minus
	nn -= minus
	bb -= min(bb - yy, nn)
	ans2 = aa * bb
	return min(ans1, ans2)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(solve(a, b, x, y, n))


import io, os, math
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
rr = lambda : input()
rri = lambda : int(input())
rrm = lambda : list(map(int, input().split()))
INF = float('inf')

def test(a, b, x, y, n, v):
	diffa = a - x
	diffb = b - y
	if v == 'a':
		if diffa <= n:
			n -= diffa
			a = x
			if diffb <= n:
				b = y
			else:
				b -= n
		else:
			a -= n
	elif diffb <= n:
		n -= diffb
		b = y
		if diffa <= n:
			a = x
		else:
			a -= n
	else:
		b -= n
	return a * b

def solve(a, b, x, y, n):
	best = float('inf')
	best = min(best, test(a, b, x, y, n, 'a'))
	best = min(best, test(a, b, x, y, n, 'b'))
	return best
t = rri()
for _ in range(t):
	(a, b, x, y, n) = rrm()
	print(solve(a, b, x, y, n))


from math import *
for i in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a - min(a - x, n) >= b - min(b - y, n):
		r = min(b - y, n)
		b -= r
		n -= r
		n = max(n, 0)
		r = min(a - x, n)
		a -= r
		n -= r
		n = max(n, 0)
	else:
		r = min(a - x, n)
		a -= r
		n -= r
		n = max(n, 0)
		r = min(b - y, n)
		b -= r
		n -= r
		n = max(n, 0)
	print(a * b)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	diff_a = a - x
	diff_b = min(b - y, n)
	temp_a = a
	temp_b = b
	temp_n = n
	mn = 0
	if diff_a >= temp_n and 0 < (temp_a - temp_n) * temp_b:
		mn = (temp_a - temp_n) * temp_b
	else:
		temp_a -= diff_a
		temp_n -= diff_a
		if diff_b >= temp_n:
			temp_b -= temp_n
		else:
			temp_b -= diff_b
		if 0 < temp_a * temp_b:
			mn = temp_a * temp_b
	diff_b = b - y
	diff_a = a - x
	if diff_b >= n:
		if 0 < (b - n) * a < mn:
			mn = (b - n) * a
	else:
		b -= diff_b
		n -= diff_b
		if diff_a >= n:
			diff_a = n
		a -= diff_a
		if 0 < a * b < mn:
			mn = a * b
	print(mn)


t = int(input())
for z in range(t):
	q = input().split()
	(a, b, x, y, w) = (int(q[0]), int(q[1]), int(q[2]), int(q[3]), int(q[4]))
	(res1, res2) = (0, 0)
	(a1, a2, b1, b2) = (a, a, b, b)
	if w > a - x:
		s1 = w - (a - x)
		a1 = x
		if s1 > b - y:
			b1 = y
		else:
			b1 -= s1
	else:
		a1 -= w
	res1 = b1 * a1
	if w > b - y:
		s2 = w - (b - y)
		b2 = y
		if s2 > a - x:
			a2 = x
		else:
			a2 -= s2
	else:
		b2 -= w
	res2 = b2 * a2
	print(min(res1, res2))


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

def solve(a, b, x, y, n):
	if n > b - y:
		n -= b - y
		b = y
	else:
		b -= n
		n = 0
	a = max(x, a - n)
	return a * b

def main():
	(a, b, x, y, n) = M()
	m1 = solve(a, b, x, y, n)
	m2 = solve(b, a, y, x, n)
	print(min(m1, m2))
tc = I()
for _ in range(tc):
	main()


import math
a = int(input())
for i in range(0, a):
	(a, b, x, y, n) = map(int, input().split())
	a1 = max(x, a - n)
	b1 = max(y, b - n)
	if a1 < b1:
		p1 = max(x, a - n)
		n = n - (a - p1)
		p2 = max(y, b - n)
		print(p1 * p2)
	else:
		p1 = max(y, b - n)
		n = n - (b - p1)
		p2 = max(x, a - n)
		print(p1 * p2)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if n >= a - x + (b - y):
		print(x * y)
	else:
		if a - x >= n:
			p1 = (a - n) * b
		else:
			p1 = x * (b - (n - (a - x)))
		if b - y >= n:
			p2 = a * (b - n)
		else:
			p2 = (a - (n - (b - y))) * y
		print(min(p1, p2))


t = int(input())
fin = []
for i in range(t):
	a = list(map(int, input().split()))
	fin.append(a)
for o in fin:
	x = o[2]
	y = o[3]
	flag = 0
	for i in range(2):
		a = o[0]
		b = o[1]
		n = o[4]
		suba = a - x
		subb = b - y
		if flag == 0:
			if n <= suba:
				a = a - n
				pdt = a * b
				flag = 1
				continue
			else:
				a = x
				n = n - suba
				if n >= subb:
					b = y
					pdt = a * b
					flag = 1
					continue
				b = b - n
				flag = 1
				pdt = a * b
		elif flag == 1:
			if n <= subb:
				b = b - n
				pdt1 = a * b
				continue
			else:
				b = y
				n = n - subb
				if n >= suba:
					a = x
					pdt1 = a * b
					continue
				a = a - n
				pdt1 = a * b
	print(min(pdt, pdt1))


t = int(input())
while t > 0:
	t -= 1
	(a, b, k, l, n) = map(int, input().split())
	m = n
	x1 = max(k, a - n)
	if x1 == k:
		n = n - (a - k)
	else:
		n = 0
	x2 = max(l, b - n)
	ans1 = x1 * x2
	n = m
	x1 = max(l, b - n)
	if x1 == l:
		n = n - (b - l)
	else:
		n = 0
	x2 = max(k, a - n)
	ans2 = x1 * x2
	print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(da, db) = (a - x, b - y)
	if n >= da + db:
		print(x * y)
	else:
		result = a * b
		for _ in range(2):
			if n > da:
				result = min(result, x * (b - (n - da)))
			else:
				result = min(result, (a - n) * b)
			(a, b, x, y, da, db) = (b, a, y, x, db, da)
		print(result)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 1e+20
	if a - x >= n:
		ans = min(ans, (a - n) * b)
	else:
		ans = min(ans, x * (b - min(n - a + x, b - y)))
	if b - y >= n:
		ans = min(ans, (b - n) * a)
	else:
		ans = min(ans, y * (a - min(n - b + y, a - x)))
	if ans < 0:
		ans = x * y
	print(ans)


def solution(arr):
	(a, b, x, y, n) = arr
	a = max(a - n, x)
	b = b - (n - (arr[0] - a))
	val = a * b
	while a < arr[0]:
		val = min(val, a * b)
		a = a + 1
		b = b - 1
	return val

def solve(arr):
	(a, b, x, y, n) = arr
	val1 = max(a - n, x)
	val3 = max(b - (n - (a - val1)), y)
	val2 = max(b - n, y)
	val4 = max(a - (n - (b - val2)), x)
	return min(val1 * val3, val2 * val4)
for _ in range(int(input())):
	arr = [int(x) for x in input().split()]
	ans = solve(arr)
	print(ans)


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

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

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

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

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

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

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

def Hash():
	return dict()

def Mod():
	return 1000000007

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

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

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

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

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

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

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

def solution():
	for _ in range(Int()):
		(a, b, x, y, n) = Mint()
		if max(x, a - n) > max(b - n, y):
			(a, b) = (b, a)
			(x, y) = (y, x)
		m = min(abs(a - x), n)
		ni = min(abs(b - y), n - m)
		a = a - m
		b = b - ni
		print(a * b)
solution()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	mn1 = a * b
	mn2 = mn1
	k = n
	(a1, b1) = (a, b)
	if a - x >= 0:
		if a - x <= n:
			n -= a - x
			a = x
		else:
			a -= n
			n = 0
		if b - y <= n:
			b = y
		else:
			b -= n
		mn1 = a * b
	a = a1
	b = b1
	n = k
	if b - y >= 0:
		if b - y <= n:
			n -= b - y
			b = y
		else:
			b -= n
			n = 0
		if a - x <= n:
			a = x
		else:
			a -= n
		mn2 = a * b
	print(min(mn1, mn2))


for i in range(int(input())):
	(a, b, c, d, x) = [int(i) for i in input().split()]
	(aa, bb) = (a, b)
	c1 = min(a - c, x)
	a -= c1
	b -= x - c1
	b = max(b, d)
	c2 = min(bb - d, x)
	bb -= c2
	aa -= x - c2
	aa = max(aa, c)
	print(min(a * b, aa * bb))


m = ['']
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, n1) = (a, b, n)
	p1 = min(a1 - x, n1)
	a1 -= p1
	b1 -= min(b1 - y, n1 - p1)
	(a2, b2, n2) = (a, b, n)
	p2 = min(b2 - y, n2)
	b2 -= p2
	a2 -= min(a2 - x, n2 - p2)
	m.append(min(a1 * b1, a2 * b2))
print(*m, sep='\n')


t = int(input())
for tc in range(1, t + 1):
	(aa, bb, xx, yy, nn) = map(int, input().split())
	(a, b, x, y, n) = (aa, bb, xx, yy, nn)
	diff = a - x
	n -= diff
	if n < 0:
		diff -= abs(n)
		n = 0
	a -= diff
	if a < x:
		a = x
	diff = b - y
	n -= diff
	if n < 0:
		diff -= abs(n)
		n = 0
	b -= diff
	if b < y:
		b = y
	res = a * b
	(a, b, x, y, n) = (aa, bb, xx, yy, nn)
	diff = b - y
	n -= diff
	if n < 0:
		diff -= abs(n)
		n = 0
	b -= diff
	if b < y:
		b = y
	diff = a - x
	n -= diff
	if n < 0:
		diff -= abs(n)
		n = 0
	a -= diff
	if a < x:
		a = x
	print(min(res, a * b))


import sys

class BMinimumProduct:

	def solve(self, tc=0):

		def f(ap, bp):
			return a * bp + b * ap - ap * bp
		for _ in range(int(input())):
			(a, b, x, y, n) = [int(_) for _ in input().split()]
			ans = a * b - max(f(0, min(n, b - y)), f(min(n, a - x), min(n - min(n, a - x), b - y)), f(min(n, a - x), 0), f(min(n - min(n, b - y), a - x), min(n, b - y)))
			print(ans)
solver = BMinimumProduct()
input = sys.stdin.readline
solver.solve()


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from collections import defaultdict
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, OrderedDict

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

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

def Neo():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(I()):
	(a, b, x, y, n) = neo()
	z1 = max(y, b - n)
	z2 = max(x, a - n)
	if z1 < z2:
		od = b - max(y, b - n)
		remainder = n - od
		z3 = max(x, a - remainder)
		ans = z3 * max(y, b - n)
	else:
		od = a - max(x, a - n)
		remainder = n - od
		z3 = max(y, b - remainder)
		ans = z3 * max(x, a - n)
	print(ans)


t = int(input())
for i in range(t):
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	x = int(s[2])
	y = int(s[3])
	n = int(s[4])
	z = max(a - n, x) * b
	m = max(b - n, y) * a
	q = max(a - n, x) * max(b - (n - (a - x)), y)
	j = max(b - n, y) * max(a - (n - (b - y)), x)
	print(min(z, m, q, j))


from sys import stdin, stdout
from math import gcd, log2, log10, floor
import math
from collections import defaultdict
input = stdin.readline

def fun(a, b, x, y, n):
	mina = min(n, a - x)
	a -= mina
	n -= mina
	mina = min(n, b - y)
	n -= mina
	b -= mina
	return a * b

def function(a, b, x, y, n):
	mina = min(n, b - y)
	n -= mina
	b -= mina
	mina = min(n, a - x)
	a -= mina
	n -= mina
	return a * b
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	mina = min(fun(a, b, x, y, n), function(a, b, x, y, n))
	print(mina)


for i in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	kol1 = 0
	kol2 = 0
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	n1 = n
	if abs(x - a) < n:
		n -= abs(x - a)
		a = x
		kol1 = x * max(y, b - n)
	else:
		kol1 = (a - n) * b
	(a, b, x, y) = (a1, b1, x1, y1)
	n = n1
	if abs(y - b) < n:
		n -= abs(y - b)
		b = y
		kol2 = y * max(x, a - n)
	else:
		kol2 = (b - n) * a
	print(min(kol1, kol2))


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

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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

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

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

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

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(a, b, x, y, n) = value()
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	new_a = max(a - n, x)
	on = n - (a - new_a)
	new_b = max(y, b - on)
	ans1 = new_a * new_b
	(a, b) = (b, a)
	(x, y) = (y, x)
	new_a = max(a - n, x)
	on = n - (a - new_a)
	new_b = max(y, b - on)
	ans2 = new_a * new_b
	print(min(ans1, ans2))


def main():
	tc = int(input().strip())
	for c in range(tc):
		(a, b, x, y, n) = [int(i) for i in input().split(' ')]
		mna = max(a - n, x)
		mnb = max(b - n, y)
		if mnb < mna:
			(a, b) = (b, a)
			(x, y) = (y, x)
		if a - n >= x:
			a -= n
		else:
			diff = a - x
			a = x
			n -= diff
			n = min(b - y, n)
			b -= n
		print(a * b)
main()


totalInp = int(input())
for i in range(totalInp):
	allInp = input().split(' ')
	for i in range(len(allInp)):
		allInp[i] = int(allInp[i])
	diff1 = allInp[0] - allInp[2]
	diff2 = allInp[1] - allInp[3]
	if allInp[0] > allInp[1]:
		(allInp[1], allInp[0]) = (allInp[0], allInp[1])
		(diff2, diff1) = (diff1, diff2)
	diff = 0
	if allInp[0] == allInp[1]:
		if diff1 > diff2:
			if diff1 > allInp[4]:
				print((allInp[0] - allInp[4]) * allInp[1])
				continue
			else:
				diff = allInp[4] - diff1
				allInp[0] -= diff1
				if diff > diff2:
					allInp[1] -= diff2
				else:
					allInp[1] -= diff
				print(allInp[0] * allInp[1])
				continue
		elif diff2 > allInp[4]:
			print((allInp[1] - allInp[4]) * allInp[0])
			continue
		else:
			diff = allInp[4] - diff2
			allInp[1] -= diff2
			if diff > diff1:
				allInp[0] -= diff1
			else:
				allInp[0] -= diff
			print(allInp[0] * allInp[1])
			continue
	else:
		minVal1 = 0
		copyVal = allInp.copy()
		copyVal2 = allInp.copy()
		copyDiff1 = diff1
		copyDiff2 = diff2
		if diff1 > copyVal[4]:
			minVal1 = (copyVal[0] - copyVal[4]) * copyVal[1]
		else:
			diff = copyVal[4] - diff1
			copyVal[0] -= diff1
			if diff > diff2:
				copyVal[1] -= diff2
			else:
				copyVal[1] -= diff
			minVal1 = copyVal[0] * copyVal[1]
		minVal2 = 0
		diff1 = copyDiff1
		diff2 = copyDiff2
		if diff2 > copyVal2[4]:
			minVal2 = (copyVal2[1] - copyVal2[4]) * copyVal2[0]
		else:
			diff = copyVal2[4] - diff2
			copyVal2[1] -= diff2
			if diff > diff1:
				copyVal2[0] -= diff1
			else:
				copyVal2[0] -= diff
			minVal2 = copyVal2[0] * copyVal2[1]
		print(min(minVal1, minVal2))


t = int(input())
ans = 0
a = [0] * t
b = [0] * t
x = [0] * t
y = [0] * t
n = [0] * t
for i in range(t):
	(a[i], b[i], x[i], y[i], n[i]) = map(int, input().split())
for i in range(t):
	sa = a[i]
	sb = b[i]
	sa -= n[i]
	if sa < x[i]:
		sa = x[i]
	sb -= n[i]
	if sb < y[i]:
		sb = y[i]
	if sa < sb:
		a[i] -= n[i]
		if a[i] < x[i]:
			n[i] = x[i] - a[i]
			a[i] = x[i]
		else:
			n[i] = 0
		b[i] -= n[i]
		if b[i] < y[i]:
			n[i] = y[i] - b[i]
			b[i] = y[i]
	else:
		b[i] -= n[i]
		if b[i] < y[i]:
			n[i] = y[i] - b[i]
			b[i] = y[i]
		else:
			n[i] = 0
		a[i] -= n[i]
		if a[i] < x[i]:
			n[i] = x[i] - a[i]
			a[i] = x[i]
	print(a[i] * b[i])


import sys
import os.path
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
	sys.stdout = open('out.txt', 'w')
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	da = a - x
	db = b - y
	if da <= n:
		a1 = x
		b1 = b - (n - da)
		if b1 <= y:
			b1 = y
	else:
		a1 = a - n
		b1 = b
		if a1 <= x:
			a1 = x
	if db <= n:
		b2 = y
		a2 = a - (n - db)
		if a2 <= x:
			a2 = x
	else:
		b2 = b - n
		a2 = a
		if b2 <= y:
			b2 = y
	print(min(a1 * b1, a2 * b2))


j = input()
for _ in range(0, int(j)):
	(a, b, x, y, n) = input().split(' ')
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	dif_a = a - n if a - n > x else x
	dif_b = b - n if b - n > y else y
	if dif_a < dif_b:
		n -= a - dif_a
		b = b - n if b - n > y else y
		a = dif_a
	else:
		n -= b - dif_b
		a = a - n if a - n > x else x
		b = dif_b
	print(a * b)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

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

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

def ws(s):
	sys.stdout.write(s + '\n')

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

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions
from collections import deque, defaultdict, OrderedDict
from fractions import Fraction
from decimal import Decimal

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		(a, b, x, y, n) = ria()
		ans1 = 0
		ans2 = 0
		c = b - y
		d = n - c
		if d > 0:
			c = a - x
			f = d
			d = d - c
			if d < 0:
				ans1 = (a - f) * y
			if d >= 0:
				ans1 = x * y
		elif n == 0:
			ans1 = a * y
		else:
			ans1 = a * (b - n)
		(a, b) = (b, a)
		(x, y) = (y, x)
		c = b - y
		d = n - c
		if d > 0:
			c = a - x
			f = d
			d = d - c
			if d < 0:
				ans2 = (a - f) * y
			if d >= 0:
				ans2 = x * y
		elif n == 0:
			ans2 = a * y
		else:
			ans2 = a * (b - n)
		print(min(ans1, ans2))
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

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

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

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


g = int(input())
for t in range(g):
	(a, b, x, y, n) = map(int, input().split())
	isALower = False
	if max(a - n, x) < max(b - n, y):
		isALower = True
	if isALower:
		remainder = 0
		if x > a - n:
			remainder = n - (a - x)
			a = x
			b = b - remainder
			if b < y:
				b = y
			if a < x:
				a = x
		else:
			a = a - n
			if a < x:
				a = x
	elif y > b - n:
		remainder = n - (b - y)
		b = y
		a = a - remainder
		if a < x:
			a = x
		if b < y:
			b = y
	else:
		b = b - n
		if b < y:
			b = y
	print(a * b)


def solver(a, b, x, y, n):
	asub = min(n, a - x)
	n -= asub
	a -= asub
	b = max(y, b - n)
	return a * b
for i in range(int(input())):
	arr = list(map(int, input().split()))
	print(min(solver(arr[0], arr[1], arr[2], arr[3], arr[4]), solver(arr[1], arr[0], arr[3], arr[2], arr[4])))


t = int(input())

def f1(a, b, x, y, n):
	da = a - x
	db = b - y
	if y < x:
		(a, b) = (b, a)
		(x, y) = (y, x)
		(da, db) = (db, da)
	if da <= n:
		a = x
		n -= da
		if db <= n:
			b -= db
			n -= db
		else:
			b -= n
		a1 = a * b
	else:
		a -= n
		a1 = a * b
	return a1

def f2(a, b, x, y, n):
	da = a - x
	db = b - y
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
		(da, db) = (db, da)
	if da <= n:
		a = x
		n -= da
		if db <= n:
			b -= db
			n -= db
		else:
			b -= n
		a1 = a * b
	else:
		a -= n
		a1 = a * b
	return a1
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	da = a - x
	db = b - y
	if da + db <= n:
		print(x * y)
		continue
	a1 = f1(a, b, x, y, n)
	a2 = f2(a, b, x, y, n)
	print(min(a1, a2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	p = 100000000000000000000000
	if a - n >= x:
		p = min(p, (a - n) * b)
	elif a - n < x:
		if b - (n - (a - x)) >= y:
			p = min(p, x * (b - (n - (a - x))))
		else:
			p = min(p, x * y)
	if b - n >= y:
		p = min(p, (b - n) * a)
	elif b - n < y:
		if a - (n - (b - y)) >= x:
			p = min(p, y * (a - (n - (b - y))))
		else:
			p = min(p, x * y)
	print(p)


test = int(input())
for q in range(test):
	(a, b, x, y, n) = map(int, input().split())
	mina = a - n
	rem = 0
	if mina < x:
		rem = x - mina
		mina = x
	if b - rem > y:
		newb = b - rem
	else:
		newb = y
	ans1 = mina * newb
	minb = b - n
	rem = 0
	if minb < y:
		rem = y - minb
		minb = y
	if a - rem > x:
		newa = a - rem
	else:
		newa = x
	ans2 = minb * newa
	print(min(ans1, ans2))


t = int(input())
while t:
	(a, b, x, y, n) = [int(i) for i in input().split()]
	temp1 = a
	temp2 = b
	temp3 = n
	diff1 = b - y
	b -= min(diff1, n)
	n -= min(diff1, n)
	a -= min(a - x, n)
	ans1 = a * b
	diff1 = temp1 - x
	temp1 -= min(diff1, temp3)
	temp3 -= min(diff1, temp3)
	temp2 -= min(temp2 - y, temp3)
	ans2 = temp1 * temp2
	print(min(ans1, ans2))
	t -= 1


import sys
pin = sys.stdin.readline
for t in range(int(pin())):
	(a, b, x, y, n) = map(int, pin().split())
	a1 = max(x, a - n)
	b2 = max(y, b - n)
	n1 = max(0, n - (a - x))
	n2 = max(0, n - (b - y))
	b1 = max(y, b - n1)
	a2 = max(x, a - n2)
	m1 = a1 * b1
	m2 = a2 * b2
	print(min(m1, m2))


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if x + n >= a:
		a1 = x
		b1 = max(y, b - n + a - x)
	else:
		a1 = a - n
		b1 = b
	if y + n >= b:
		a2 = max(x, a - n + b - y)
		b2 = y
	else:
		a2 = a
		b2 = b - n
	r1 = a1 * b1
	r2 = a2 * b2
	print(min(r1, r2))


t = int(input())
for g in range(0, t):
	abxyn = list(map(int, input().split()))
	a = abxyn[0]
	b = abxyn[1]
	x = abxyn[2]
	y = abxyn[3]
	n = abxyn[4]
	if y >= x:
		if n >= a - x:
			n = n - (a - x)
			a = x
			if n >= b - y:
				b = y
			else:
				b = b - n
			print(a * b)
		elif a - n > max(y, b - n):
			if n >= b - y:
				n = n - (b - y)
				b = y
			else:
				b = b - n
				n = 0
			if n >= a - x:
				a = x
			else:
				a = a - n
				n = 0
			print(a * b)
		else:
			a = a - n
			n = 0
			print(a * b)
	else:
		(a, b) = (b, a)
		(x, y) = (y, x)
		if n >= a - x:
			n = n - (a - x)
			a = x
			if n >= b - y:
				b = y
			else:
				b = b - n
			print(a * b)
		elif a - n > max(y, b - n):
			if n >= b - y:
				n = n - (b - y)
				b = y
			else:
				b = b - n
				n = 0
			if n >= a - x:
				a = x
			else:
				a = a - n
				n = 0
			print(a * b)
		else:
			a = a - n
			n = 0
			print(a * b)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	mina = max(x, a - n)
	minb = max(y, b - n)
	if mina <= minb:
		i = 0
		if a - n > x:
			i += n
		else:
			i += a - x
		a = mina
		minb = max(y, b - (n - i))
		b = minb
	else:
		i = 0
		if b - n > y:
			i += n
		else:
			i += b - y
		b = minb
		mina = max(x, a - (n - i))
		a = mina
	print(a * b)


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

def solve():
	(a, b, x, y, n) = invr()
	qq = a
	ww = b
	q = min(n, b - y)
	b = b - q
	a = a - min(n - q, a - x)
	qqqq = a * b
	a = qq
	b = ww
	q = min(n, a - x)
	a = a - q
	b = b - min(n - q, b - y)
	wwww = a * b
	print(min(qqqq, wwww))

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

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

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

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

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

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

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

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

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % m
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	res = n - (a - max(x, a - n))
	ans1 = max(x, a - n) * max(y, b - res)
	res = n - (b - max(y, b - n))
	ans2 = max(y, b - n) * max(x, a - res)
	print(min(ans1, ans2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if max(a - n, x) < max(b - n, y):
		tmp = max(a - n, x)
		tmp2 = n - (a - tmp)
		print(max(a - n, x) * max(b - tmp2, y))
	else:
		tmp = max(b - n, y)
		tmp2 = n - (b - tmp)
		print(max(a - tmp2, x) * max(b - n, y))


import math
rr = lambda : input().strip()
rrm = lambda : map(int, rr().split())

def solve():
	(a, b, x, y, n) = rrm()
	n1 = n
	if a + b - x - y <= n:
		return x * y
	ans = 0
	t1 = max(b - n, y)
	n -= b - t1
	t2 = max(a - n, x)
	ans = t1 * t2
	n = n1
	t1 = max(a - n, x)
	n -= a - t1
	t2 = max(b - n, y)
	ans = min(ans, t1 * t2)
	return ans
T = int(rr())
for _ in range(T):
	ans = solve()
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ntemp = n
	amin = max(x, a - n)
	n = n - (a - amin)
	bmin = max(y, b - n)
	ans1 = amin * bmin
	n = ntemp
	bmin = max(y, b - n)
	n = n - (b - bmin)
	amin = max(x, a - n)
	ans2 = amin * bmin
	print(min(ans2, ans1))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(x1, y1, x2, y2) = (x, y, x, y)
	s = a - x + b - y
	if n >= s:
		print(x * y)
	else:
		n1 = s - n
		n2 = s - n
		if n1 <= a - x:
			x1 += n1
		else:
			(x1, n1) = (a, n1 - (a - x1))
			y1 += n1
		if n2 <= b - y:
			y2 += n2
		else:
			(y2, n2) = (b, n2 - (b - y2))
			x2 += n2
		print(min(x1 * y1, x2 * y2))


import sys
pprint = lambda s: print(' '.join(map(lambda x: str(x), s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
mod = 1000000007
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a < b:
		(a, b, x, y) = (b, a, y, x)
	if b - y < n:
		(a1, b1, x1, y1, n1) = (a, b, x, y, n)
		n -= b - y
		b = y
		a = max(a - n, x)
		d = a1 - max(a1 - n1, x)
		a1 -= d
		n1 -= d
		b1 = max(y, b1 - n1)
		print(min(a * b, a1 * b1))
	else:
		print((b - n) * a)


for _ in range(0, int(input())):
	(a, b, x, y, n) = map(int, input().split())
	p = a
	q = b
	t = n
	if x <= y:
		if a - n >= x:
			a = a - n
			n = 0
		else:
			k = a - x
			n = n - k
			a = a - k
		if b - n >= y:
			b = b - n
			n = 0
		else:
			k = b - y
			n = n - k
			b = b - k
		if q - t >= y:
			q = q - t
			t = 0
		else:
			k = q - y
			t = t - k
			q = q - k
		if p - t >= x:
			p = p - t
			t = 0
		else:
			k = p - x
			t = t - k
			p = p - k
	else:
		if b - n >= y:
			b = b - n
			n = 0
		else:
			k = b - y
			n = n - k
			b = b - k
		if a - n >= x:
			a = a - n
			n = 0
		else:
			k = a - x
			n = n - k
			a = a - k
		if p - t >= x:
			p = p - t
			t = 0
		else:
			k = p - x
			t = t - k
			p = p - k
		if q - t >= y:
			q = q - t
			t = 0
		else:
			k = q - y
			t = t - k
			q = q - k
	print(min(a * b, p * q))


def get_ans(a, b, x, y, n):
	r1 = 0
	if a - n < x:
		r1 = x * max(b - (x - (a - n)), y)
	else:
		r1 = (a - n) * b
	r2 = 0
	if b - n < y:
		r2 = y * max(a - (y - (b - n)), x)
	else:
		r2 = a * (b - n)
	return min(r1, r2)
t = int(input())
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	print(get_ans(a, b, x, y, n))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(v, g) = (0, 0)
	(j, k, l, no, mo) = (a, b, x, y, n)
	if True:
		b = b - n
		n = 0
		if b < y:
			n = y - b
			b = y
		a = a - n
		if a < x:
			a = x
		v = a * b
	(a, b, x, y, n) = (j, k, l, no, mo)
	if True:
		a = a - n
		n = 0
		if a < x:
			n = x - a
			a = x
		b = b - n
		if b < y:
			b = y
		g = a * b
	print(min(v, g))


import math

def ans2(a, b, x, y, n):
	gap = a - x
	a -= min(n, gap)
	n -= min(n, gap)
	gap = b - y
	b -= min(n, gap)
	n -= min(n, gap)
	return a * b

def ans(a, b, x, y, n):
	return min(ans2(a, b, x, y, n), ans2(b, a, y, x, n))
T = int(input())
for t in range(T):
	(A, B, X, Y, N) = input().split()
	A = int(A)
	B = int(B)
	X = int(X)
	Y = int(Y)
	N = int(N)
	print(ans(A, B, X, Y, N))


import math
for _ in range(int(input())):
	(a, b, x, y, n) = [int(c) for c in input().split()]
	if a == x and b == y:
		print(a * b)
	elif a - x + (b - y) <= n:
		print(x * y)
	else:
		ans1 = 0
		ans2 = 0
		p = a
		q = b
		if a - n >= x:
			a -= n
			ans1 = a * b
		else:
			b = b - (n - (a - x))
			a = x
			ans1 = a * b
		(a, b) = (p, q)
		if b - n >= y:
			b -= n
			ans2 = a * b
		else:
			a -= n - (b - y)
			b = y
			ans2 = a * b
		print(min(ans1, ans2))


for x in range(int(input())):
	(a, b, c, d, n) = map(int, input().split())
	af = max(a - n, c)
	m = n - a + af
	bf = max(b - m, d)
	p1 = af * bf
	bf = max(b - n, d)
	m = n - b + bf
	af = max(a - m, c)
	p2 = af * bf
	print(min(p1, p2))


T = int(input())
for t in range(T):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if n >= a - x + b - y:
		print(x * y)
	else:
		sub = min(n, a - x)
		a -= sub
		n -= sub
		sub = min(n, b - y)
		b -= sub
		op1 = a * b
		sub = min(n1, b1 - y1)
		b1 -= sub
		n1 -= sub
		sub = min(n1, a1 - x)
		a1 -= sub
		op2 = a1 * b1
		print(min(op1, op2))


import sys, collections
tc = int(sys.stdin.readline())
for _ in range(tc):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split())
	ans = []
	if n - min(n, a - x) > 0:
		temp = n - min(n, a - x)
		ans.append((a - min(n, a - x), b - min(temp, b - y)))
	else:
		ans.append((a - min(n, a - x), b))
	if n - min(n, b - y) > 0:
		temp = n - min(n, b - y)
		ans.append((a - min(temp, a - x), b - min(n, b - y)))
	else:
		ans.append((a, b - min(n, b - y)))
	if n % 2 == 0:
		ans.append((a - n // 2, b - n // 2))
	else:
		ans.append((a - (n // 2 + 1), b - (n // 2 - 1)))
		ans.append((a - (n // 2 - 1), b - (n // 2 + 1)))
	res = []
	for i in ans:
		if i[0] >= x and i[1] >= y:
			res.append(i[0] * i[1])
	print(min(res))


for i in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a + b - (x + y) <= n:
		print(x * y)
	else:
		if a - n > x:
			p = a - n
			q = b
		else:
			p = x
			q = b - (n - (a - x))
		if b - n > y:
			r = b - n
			s = a
		else:
			r = y
			s = a - (n - (b - y))
		print(min(p * q, r * s))


for q in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a < b:
		(A, B, N) = (a, b, n)
		Y = min(n, a - x)
		n -= Y
		a -= Y
		Y = min(n, b - y)
		b -= Y
		res = a * b
		(a, b, n) = (A, B, N)
		Y = min(n, b - y)
		n -= Y
		b -= Y
		Y = min(n, a - x)
		a -= Y
		print(min(a * b, res))
	else:
		(A, B, N) = (a, b, n)
		Y = min(n, b - y)
		n -= Y
		b -= Y
		Y = min(n, a - x)
		a -= Y
		res = a * b
		(a, b, n) = (A, B, N)
		Y = min(n, a - x)
		n -= Y
		a -= Y
		Y = min(n, b - y)
		b -= Y
		print(min(a * b, res))


T = int(input())
for t in range(T):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	copies = [a, b, x, y, n]
	aold = a
	a = max(x, a - n)
	n -= aold - a
	if n != 0:
		b = max(y, b - n)
	prod1 = a * b
	(a, b, x, y, n) = copies
	bold = b
	b = max(y, b - n)
	n -= bold - b
	if n != 0:
		a = max(x, a - n)
	prod2 = a * b
	print(min(prod1, prod2))


def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = [int(x) for x in input().split()]
		minProduct = x * y
		if a - x + b - y <= n:
			print(minProduct)
			continue
		product1 = 1
		product2 = 1
		(A, B, N) = (a, b, n)
		if a - x >= n:
			a -= n
			product1 = a * b
		else:
			n = n - (a - x)
			a = x
			b -= n
			product1 = a * b
		(a, b, n) = (A, B, N)
		if b - y >= n:
			b -= n
			product2 = a * b
		else:
			n = n - (b - y)
			b = y
			a -= n
			product2 = a * b
		product = min(product1, product2)
		print(product)
main()


def solve():
	(a, b, x, y, n) = map(int, input().split())
	if a >= b:
		(y, x) = (x, y)
		(a, b) = (b, a)
	if a - x + b - y <= n:
		print(x * y)
		return 0
	zn = a * b
	if a - x <= n:
		zn = min(zn, x * (b - (n - a + x)))
	else:
		zn = min(zn, (a - n) * b)
	if b - y <= n:
		zn = min(zn, y * (a - (n - b + y)))
	else:
		zn = min(zn, (b - n) * a)
	print(zn)
for i in range(int(input())):
	solve()


import math
t = int(input())
res = 0
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		print(x * y)
		continue
	op1 = min(n, a - x)
	op2 = min(n, b - y)
	res1 = min((a - op1) * (b - n + op1), (b - op2) * (a - n + op2))
	print(res1)


import sys
read = lambda : sys.stdin.readline().strip()
for _ in range(int(read())):
	(a, b, x, y, n) = map(int, read().split())
	ans1 = ans2 = 0
	if a - n >= x:
		ans1 = (a - n) * b
	else:
		ans1 = x * (b - min((b - y, n - (a - x))))
	if b - n >= y:
		ans2 = a * (b - n)
	else:
		ans2 = (a - min(a - x, n - (b - y))) * y
	print(min(ans1, ans2))


import sys
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(A, B) = (a, b)
	ans = 10 ** 18
	if a - n >= x:
		a -= n
		ans = min(ans, a * b)
	else:
		rem = n - (a - x)
		a = x
		if b - rem >= y:
			b -= rem
		else:
			b = y
		ans = min(ans, a * b)
	a = A
	b = B
	if b - n >= y:
		b -= n
		ans = min(ans, a * b)
	else:
		rem = n - (b - y)
		b = y
		if a - rem >= x:
			a -= rem
		else:
			a = x
		ans = min(ans, a * b)
	print(ans)


t = int(input())
ans = []
for i in range(t):
	l = input()
	a = int(l.split()[0])
	b = int(l.split()[1])
	x = int(l.split()[2])
	y = int(l.split()[3])
	n = int(l.split()[4])
	a1 = a
	b1 = b
	n1 = n
	if a - x < n:
		n = n - (a - x)
		a = x
		if b - y < n:
			b = y
		else:
			b = b - n
		ans1 = a * b
	else:
		a = a - n
		ans1 = a * b
	if b1 - y < n1:
		n1 = n1 - (b1 - y)
		b1 = y
		if a1 - x < n1:
			a1 = x
		else:
			a1 = a1 - n1
		ans2 = a1 * b1
	else:
		b1 = b1 - n1
		ans2 = a1 * b1
	ans.append(min(ans1, ans2))
for i in range(len(ans)):
	print(ans[i])


import sys
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	(a1, b1, x1, y1) = (a, b, x, y)
	r = n
	k = min(n, a - x)
	n -= k
	a -= k
	b -= min(n, b - y)
	o = a * b
	n = r
	(a, b, x, y) = (a1, b1, x1, y1)
	k = min(n, b - y)
	n -= k
	b -= k
	a -= min(n, a - x)
	o = min(o, a * b)
	print(o)


t = int(input())
for i in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	d = a
	e = b
	f = x
	g = y
	h = n
	p = a - x
	if p >= n:
		u = b * (a - n)
	else:
		n = n - (a - x)
		b = b - n
		if b >= y:
			u = x * b
		else:
			u = x * y
	a = d
	b = e
	x = f
	y = g
	n = h
	q = b - y
	if q >= n:
		v = a * (b - n)
	else:
		n = n - (b - y)
		a = a - n
		if a >= x:
			v = y * a
		else:
			v = x * y
	print(min(u, v))


import sys
import math
from _collections import defaultdict
input = sys.stdin.readline
t = int(input())

def inar():
	return [int(el) for el in input().split()]
for _ in range(t):
	(a, b, x, y, n) = inar()
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	ans1 = 0
	ans2 = 0
	diff = a - x
	s = min(diff, n)
	a -= s
	n -= s
	diff2 = b - y
	s = min(diff2, n)
	b -= s
	ans1 = a * b
	diff = b1 - y1
	s = min(diff, n1)
	b1 -= s
	n1 -= s
	diff2 = a1 - x1
	s = min(diff2, n1)
	a1 -= s
	ans2 = a1 * b1
	print(min(ans1, ans2))


n = int(input())
for i in range(n):
	(a, b, x, y, n) = list(map(int, input().split()))
	tmp_a = 0
	tmp_b = 0
	if a - x >= n:
		tmp_a = (a - n) * b
	else:
		tmp = b - (n - (a - x))
		if tmp > y:
			tmp_a = x * tmp
		else:
			tmp_a = x * y
	if b - y >= n:
		tmp_b = (b - n) * a
	else:
		tmp = a - (n - (b - y))
		if tmp > x:
			tmp_b = y * tmp
		else:
			tmp_b = x * y
	print(min(tmp_a, tmp_b))


t = int(input())
l = []
for i in range(t):
	s = list(map(int, input().split()))
	l.append(s)
for j in l:
	(a, b, x, y, n) = tuple(j)
	m1 = max(x, a - n)
	m2 = max(y, b - n)
	mi = min(m1, m2)
	if mi == m1:
		n = n - (a - m1)
		print(mi * max(y, b - n))
	else:
		n = n - (b - m2)
		print(mi * max(x, a - n))


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	pd = 10 ** 20
	if a + b - x - y > n:
		if a - n >= x:
			a1 = a - n
			pd = abs(a1 * b)
		else:
			a1 = x
			b1 = b - (n - (a - x))
			pd = min(pd, a1 * b1)
		if b - n >= y:
			b1 = b - n
			pd = min(pd, b1 * a)
		else:
			b1 = y
			a1 = a - (n - (b - y))
			pd = min(pd, a1 * b1)
		print(pd)
	else:
		print(x * y)


import sys
input = sys.stdin.readline
import heapq
import copy
import math
import decimal

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

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

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

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

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

def pr_list(a):
	print(*a, sep=' ')

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

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	ans = 0
	stack = []
	hashm = {}
	arr = []
	heapq.heapify(arr)
	for test in range(tests):
		[a, b, x, y, n] = inlt()
		if a - n > x:
			case1 = (a - n) * b
		else:
			case1 = x * max(y, b - (n - (a - x)))
		if b - n > y:
			case2 = (b - n) * a
		else:
			case2 = y * max(x, a - (n - (b - y)))
		print(min(case1, case2))
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a == b:
		if min(x, y) == x:
			c = a
			a -= min(abs(x - a), n)
			n -= abs(x - c)
			if n >= 1:
				b -= min(b - y, abs(n))
			print(a * b)
		else:
			c = b
			b -= min(b - y, abs(n))
			n -= abs(y - c)
			if n >= 1:
				a -= min(abs(x - a), n)
			print(a * b)
	else:
		m = n
		c = a
		h = a
		j = b
		h -= min(abs(x - a), abs(m))
		m -= abs(x - c)
		if m >= 1:
			j -= min(abs(y - b), abs(m))
		ans = h * j
		c = b
		h = b
		j = a
		h -= min(abs(y - b), abs(n))
		n -= abs(y - c)
		if n >= 1:
			j -= min(abs(x - a), abs(n))
		res = h * j
		print(min(res, ans))


query = int(input())
for i in range(query):
	(a, b, x, y, steps) = map(int, input().split())
	min_ = min(a, b)
	steps_avail_a = a - x
	steps_avail_b = b - y
	if a - min(steps_avail_a, steps) < b - min(steps_avail_b, steps):
		a = a - min(steps_avail_a, steps)
		steps -= min(steps_avail_a, steps)
		b = b - min(steps_avail_b, steps)
		steps -= min(steps_avail_a, steps)
	else:
		b = b - min(steps_avail_b, steps)
		steps -= min(steps_avail_b, steps)
		a = a - min(steps_avail_a, steps)
		steps -= min(steps_avail_b, steps)
	print(a * b)


import sys
import math
mod = 998244353
cases = True
dynamic_factorial = False

def main(test_case=False):
	n = int(input()) if test_case else 1
	for _ in range(n):
		test()

def fast_pow(a: int, b: int):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def c2(n):
	return n * (n - 1) // 2

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

def bits(n: int):
	return list(bin(n)).count('1')

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

def parr(arr):
	print(*arr, sep=' ')

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

def ext_gcd(a: int, b: int):
	if b == 0:
		return [a, [1, 0]]
	res = ext_gcd(b, a % b)
	g = res[0]
	if g != 1:
		return False
	x1 = res[1][0]
	y1 = res[1][1]
	x = y1
	y = x1 - y1 * (a // b)
	return [g, [x, y]]

def get_set(a):
	res = {}
	for x in a:
		if x in res:
			res[x] += 1
		else:
			res[x] = 1
	return res
fact = {0: 1}

def factorial(n):
	if dynamic_factorial:
		if n not in fact:
			fact[n] = factorial(n - 1) * n
		return fact[n]
	else:
		res = 1
		while n > 0:
			res = res * n % mod
			n -= 1
		return res

def sum_of(a):
	res = 0
	for x in a:
		res = (res + x) % mod
	return res

def prod_of(a):
	res = 1
	for x in a:
		res = res * x % mod
	return res

def test():
	(a, b, x, y, n) = get()
	ans1 = solve(a, b, x, y, n)
	ans2 = solve(b, a, y, x, n)
	print(min(ans1, ans2))

def solve(a, b, x, y, n):
	_a = min(a - x, n)
	a -= _a
	n -= _a
	_b = min(b - y, n)
	b -= _b
	n -= _b
	return a * b
main(cases)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	best = int(2e+18 + 1)
	for _ in range(2):
		dif_A = a - x
		dif_B = b - y
		a_1 = min(dif_A, n)
		b_1 = min(dif_B, n - a_1)
		best = min(best, (a - a_1) * (b - b_1))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(best)


def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = map(int, input().split())
		ans = pow(10, 18)
		if a - x <= n:
			nokori = n - (a - x)
			na = x
			nb = max(y, b - nokori)
			ans = min(ans, na * nb)
		if b - y <= n:
			nokori = n - (b - y)
			na = max(x, a - nokori)
			nb = y
			ans = min(ans, na * nb)
		na = max(x, a - n)
		nb = b
		ans = min(ans, na * nb)
		na = a
		nb = max(y, b - n)
		ans = min(ans, na * nb)
		if a > b and a - b <= n:
			nokori = n - (a - b)
			if nokori % 2 == 0:
				na = max(x, b - nokori // 2)
				nb = max(y, b - nokori // 2)
				ans = min(ans, na * nb)
			else:
				na = max(x, b - nokori // 2 - 1)
				nb = max(y, b - nokori // 2)
				ans = min(ans, na * nb)
				na = max(x, b - nokori // 2)
				nb = max(y, b - nokori // 2 - 1)
				ans = min(ans, na * nb)
		print(ans)
main()


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


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ma = max(a - n, x)
	mb = max(b - n, y)
	print(min(ma * max(b - max(n - (a - ma), 0), y), mb * max(a - max(n - (b - mb), 0), x)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	diffa = a - x
	diffb = b - y
	A = a
	B = b
	if n > diffb:
		b = y
		a = max(a - n + diffb, x)
	else:
		b = max(y, b - n)
	if n > diffa:
		A = x
		B = max(B - n + diffa, y)
	else:
		A = max(x, A - n)
	ans = min(a * b, A * B)
	print(ans)


for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a >= b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a <= b:
		min_val_a = max(a - n, x)
		if min_val_a == x:
			diff = n - (a - min_val_a)
			min_val_b = max(b - diff, y)
		else:
			min_val_b = b
		val1 = min_val_a * min_val_b
		min_val_b = max(b - n, y)
		if min_val_b == y:
			diff = n - (b - min_val_b)
			min_val_a = max(a - diff, x)
		else:
			min_val_a = a
		val2 = min_val_b * min_val_a
		print(min(val1, val2))


for t in range(int(input())):
	(aa, bb, xx, yy, nn) = map(int, input().split())
	(a, b, x, y, n) = (aa, bb, xx, yy, nn)
	c = b - y
	d = a - x
	(m, p, o, q) = (0, 0, 0, 0)
	if c >= n:
		b = b - n
		m = a * b
	else:
		b = y
		n -= c
		if n <= d:
			a -= n
		else:
			a = x
		m = a * b
	(a, b, x, y, n) = (aa, bb, xx, yy, nn)
	if d >= n:
		a -= n
		q = a * b
	else:
		a = x
		n -= d
		if n <= c:
			b -= n
		else:
			b = y
		q = a * b
	print(min(m, q))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	c = a
	d = b
	n1 = n
	d1 = min(a - x, n)
	a -= d1
	n -= d1
	d2 = min(b - y, n)
	b -= d2
	d3 = min(d - y, n1)
	d -= d3
	n1 -= d3
	d4 = min(c - x, n1)
	c -= d4
	print(min(a * b, c * d))


def get(a, b, x, y, n):
	if a + b - (x + y) <= n:
		return x * y
	s1 = s2 = 0
	if a - x < n:
		s1 = x * (b - (n - (a - x)))
	else:
		s1 = (a - n) * b
	if b - y < n:
		s2 = y * (a - (n - (b - y)))
	else:
		s2 = (b - n) * a
	if s1 > s2:
		return s2
	return s1
t = int(input())
data = []
for i in range(t):
	data.append(list(map(int, input().split())))
for (a, b, x, y, n) in data:
	print(get(a, b, x, y, n))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(p, q, h, k) = (0, 0, 0, 0)
	m = n
	p = (a - x - n) * (a - n >= x) + x
	n = n - a + p
	q = (b - y - n) * (b - n > y) + y
	h = (b - y - m) * (b - m >= y) + y
	m = m - b + h
	k = (a - x - m) * (a - m > x) + x
	print(min(p * q, h * k))


def product(a, b, x, y, n):
	diff = a - x
	if diff < n:
		a = a - diff
		n = n - diff
	else:
		a = a - n
		n = 0
	diff = b - y
	if diff < n:
		b = b - diff
	else:
		b = b - n
	return a * b
no_tests = int(input())
for i in range(no_tests):
	(a, b, x, y, n) = map(int, input().split(' '))
	print(min(product(a, b, x, y, n), product(b, a, y, x, n)))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(s) for s in input().split(' ')]
	if a - n >= x:
		min_a = a - n
		n1 = 0
	else:
		min_a = x
		n1 = n - (a - x)
	if b - n >= y:
		min_b = b - n
		n2 = 0
	else:
		min_b = y
		n2 = n - (b - y)
	if min_a <= min_b:
		print(min_a * max(y, b - n1))
	else:
		print(min_b * max(x, a - n2))


T = int(input())

def go(a, b, x, y, n):
	first_reduct = min(n, a - x)
	a -= first_reduct
	n -= first_reduct
	second_reduct = min(n, b - y)
	b -= second_reduct
	return a * b
for t in range(T):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	print(min(go(a, b, x, y, n), go(b, a, y, x, n)))


from sys import stdin, stdout

def main():
	t = int(stdin.readline())
	for _ in range(t):
		(a, b, x, y, n) = [int(i) for i in stdin.readline().split()]
		(a_s, b_s, n_s) = (a, b, n)
		op = min(a_s - x, n_s)
		a_s -= op
		n_s -= op
		op = min(b_s - y, n_s)
		b_s -= op
		n_s -= op
		(a_t, b_t, n_t) = (a, b, n)
		op = min(b_t - y, n_t)
		b_t -= op
		n_t -= op
		op = min(a_t - x, n_t)
		a_t -= op
		n_t -= op
		prod = min(a_s * b_s, a_t * b_t)
		stdout.write('{}\n'.format(prod))
main()


z = int(input())
for _ in range(z):
	(a, b, x, y, n) = map(int, input().split())
	if n + x + y >= a + b:
		print(x * y)
	elif n + x >= a and n + y >= b:
		e = min(x, y)
		if e == x:
			print(x * (b - (n - (a - x))))
		elif e == y:
			print(y * (a - (n - (b - y))))
	elif n + x >= a and b - n <= x:
		print((b - n) * a)
	elif n + x >= a and b - n > x:
		print(x * (b - (n - (a - x))))
	elif n + y >= b and a - n <= y:
		print((a - n) * b)
	elif n + y >= b and a - n > y:
		print(y * (a - (n - (b - y))))
	else:
		if a >= b:
			print((b - n) * a)
		if b > a:
			print((a - n) * b)


for _ in range(int(input())):
	v = list(map(int, input().split()))
	i = 0 if max(v[0] - v[4], v[2]) < max(v[1] - v[4], v[3]) else 1
	step = min(v[4], v[i] - v[2 + i])
	v[i] -= step
	v[4] -= step
	i = (i + 1) % 2
	step = min(v[4], v[i] - v[2 + i])
	v[i] -= step
	print(v[0] * v[1])


for _ in range(int(input())):
	(a, b, x, y, m) = map(int, input().split())
	c = a
	g = b
	m1 = m
	e = b - y
	f = a - x
	b -= min(m, e)
	m -= min(m, e)
	a -= min(m, f)
	m -= min(m, f)
	e1 = g - y
	f1 = c - x
	c -= min(m1, f1)
	m1 -= min(m1, f1)
	g -= min(m1, e1)
	print(min(c * g, a * b))


for nt in range(int(input())):
	(a, b, x1, y1, n) = map(int, input().split())
	(x, y) = (x1, y1)
	if a - x + (b - y) <= n:
		print(x * y)
		continue
	diff = a - x + (b - y) - n
	if x >= y:
		(x, diff) = (x + min(diff, a - x), diff - min(diff, a - x))
		y += diff
		a2 = x * y
	else:
		(y, diff) = (y + min(diff, b - y), diff - min(diff, b - y))
		x += diff
		a2 = x * y
	(x, y) = (x1, y1)
	if a > b:
		(b, n) = (b - min(n, b - y), n - min(n, b - y))
		a -= min(n, a - x)
		a1 = a * b
	elif a == b:
		if y >= x:
			(a, n) = (a - min(n, a - x), n - min(n, a - x))
			b -= min(n, b - y)
			a1 = a * b
		else:
			(b, n) = (b - min(n, b - y), n - min(n, b - y))
			a -= min(n, a - x)
			a1 = a * b
	else:
		(a, n) = (a - min(n, a - x), n - min(n, a - x))
		b -= min(n, b - y)
		a1 = a * b
	print(min(a1, a2))


t = int(input())
while t > 0:
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, n1) = (a, b, n)
	temp1 = 10 ** 18
	temp = a - x
	if n >= temp:
		a = x
		n -= temp
		temp2 = b - y
		if n > temp2:
			b = y
			temp1 = min(temp1, a * b)
		else:
			b -= n
			temp1 = min(temp1, a * b)
	elif temp > n:
		a -= n
		temp1 = min(temp1, a * b)
	(a, b, n) = (a1, b1, n1)
	temp = b - y
	if n >= temp:
		b = y
		n -= temp
		temp2 = a - x
		if n > temp2:
			a = x
			temp1 = min(temp1, a * b)
		else:
			a -= n
			temp1 = min(temp1, a * b)
	elif temp > n:
		b -= n
		temp1 = min(temp1, a * b)
	print(temp1)
	t -= 1


t = int(input())

def minProd(a, b, x, y, n):
	a_x = a - x
	b_y = b - y
	if a_x + b_y <= n:
		a -= a_x
		b -= b_y
		print(a * b)
	elif min(a_x, b_y) >= n:
		a -= n
		res1 = a * b
		a += n
		b -= n
		res2 = a * b
		print(min(res1, res2))
	elif max(a_x, b_y) <= n:
		a -= a_x
		b -= n - a_x
		res1 = a * b
		a += a_x
		a -= n - b_y
		b += n - a_x
		b -= b_y
		res2 = a * b
		print(min(res1, res2))
	elif a_x <= n:
		a -= a_x
		b -= n - a_x
		res1 = a * b
		a += a_x
		b -= a_x
		res2 = a * b
		print(min(res1, res2))
	elif b_y <= n:
		b -= b_y
		a -= n - b_y
		res1 = a * b
		b += b_y
		a -= b_y
		res2 = a * b
		print(min(res1, res2))
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	minProd(a, b, x, y, n)


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	(a, b, c, d, e) = (l[0], l[1], l[2], l[3], l[4])
	m = a - min(a - c, e)
	n = b - min(b - d, e - min(a - c, e))
	r1 = m * n
	m = b - min(b - d, e)
	n = a - min(a - c, e - min(b - d, e))
	r2 = m * n
	print(min(r1, r2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	n1 = n
	p1 = 10 ** 20
	p2 = 10 ** 20
	if a - x >= n:
		p1 = (a - n) * b
	else:
		a1 = max(a - n, x)
		n -= a - a1
		b1 = max(b - n, y)
		p1 = a1 * b1
	n = n1
	if b - y >= n:
		p2 = (b - n) * a
	else:
		b1 = max(b - n, y)
		n -= b - b1
		a1 = max(a - n, x)
		p2 = a1 * b1
	print(min(p1, p2))


def test_a(a, b, x, y, n):
	times = min(n, a - x)
	a -= times
	times = min(n - times, b - y)
	b -= times
	return a * b

def test_b(a, b, x, y, n):
	times = min(n, b - y)
	b -= times
	times = min(n - times, a - x)
	a -= times
	return a * b

def main():
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		t = a
		a = b
		b = t
		t = x
		x = y
		y = t
	print(min(test_a(a, b, x, y, n), test_b(a, b, x, y, n)))
for _ in range(int(input())):
	main()


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	dec1 = a - x
	dec2 = b - y
	if dec1 + dec2 <= n:
		print(x * y)
		continue
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
		(dec1, dec2) = (dec2, dec1)
	if dec1 >= n:
		print((a - n) * b)
	else:
		b_reduction = max(0, n - dec1)
		ans1 = x * (b - b_reduction)
		a_reduction = max(0, n - dec2)
		b_reduction = min(n, dec2)
		ans2 = (a - a_reduction) * (b - b_reduction)
		print(min(ans1, ans2))


def red_by_n(a, b, x, y, n):
	upd_a = max(x, a - n)
	rem_n = max(0, n - (a - x))
	upd_b = max(y, b - rem_n)
	return upd_a * upd_b
for s in [*open(0)][1:]:
	(a, b, x, y, n) = map(int, s.split())
	print(min(red_by_n(a, b, x, y, n), red_by_n(b, a, y, x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	sa = a - x
	sb = b - y
	(af, bf) = (x, y)
	(n1, n2) = (n, n)
	if sa > n:
		af += sa - n
		n1 = 0
	else:
		n1 -= sa
	if sb > n:
		bf += sb - n
		n2 = 0
	else:
		n2 -= sb
	if af < bf:
		k = a - af
		n -= k
		bf = b - min(sb, n)
	else:
		k = b - bf
		n -= k
		af = a - min(sa, n)
	print(af * bf)


import sys
from sys import setrecursionlimit
from collections import defaultdict
setrecursionlimit(10 ** 5)
readline = sys.stdin.readline

def process():
	(a, b, x, y, n) = map(int, readline().strip().split())
	mn = float('+INF')
	if a - n >= x:
		mn = min(mn, (a - n) * b)
	else:
		left = n - (a - x)
		mn = min(mn, x * (b - min(left, b - y)))
	if b - n >= y:
		mn = min(mn, a * (b - n))
	else:
		left = n - (b - y)
		mn = min(mn, y * (a - min(left, a - x)))
	return mn
for _ in range(int(readline())):
	print(process())


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	r1 = 0
	r2 = 0
	aa = a
	bb = b
	xx = x
	yy = y
	no = n
	nn = 0
	if n > a - x:
		nn = n - (a - x)
	else:
		nn = n - n
	a -= min(a - x, n)
	if nn > 0:
		b -= min(b - y, nn)
	r1 = a * b
	nn = 0
	if no > bb - yy:
		nn = no - (bb - yy)
	else:
		nn = no - no
	bb -= min(bb - yy, no)
	if nn > 0:
		aa -= min(aa - xx, nn)
	r2 = aa * bb
	print(min(r1, r2))


def min_product(a, b, x, y, n):
	min_a = max(a - n, x)
	min_b = max(b - n, y)
	minimum_val_for_a = min_a * max(b - max(n - (a - min_a), 0), y)
	minimum_val_for_b = min_b * max(a - max(n - (b - min_b), 0), x)
	return min(minimum_val_for_a, minimum_val_for_b)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min_product(a, b, x, y, n))


import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	min_a = max(x, a - n)
	min_b = max(y, b - n)
	if min_a > min_b:
		(a, b) = (b, a)
		(x, y) = (y, x)
		(min_a, min_b) = (min_b, min_a)
	n -= a - min_a
	a = min_a
	if n > 0:
		b = max(y, b - n)
	print(a * b)


from math import *
t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = [int(x) for x in input().split()]
	(sa, sb, sx, sy) = (a, b, x, y)
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a == b:
		if x > y:
			(x, y) = (y, x)
	left = n
	na = max(x, a - left)
	left -= abs(a - na)
	a = na
	b = max(y, b - left)
	ans = a * b
	(a, b, x, y) = (sa, sb, sx, sy)
	left = n
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a == b:
		if x > y:
			(x, y) = (y, x)
	left = n
	na = max(x, a - left)
	left -= abs(a - na)
	a = na
	b = max(y, b - left)
	ans = min(ans, a * b)
	print(ans)
	ans = a * b


for i in range(int(input())):
	lst = list(map(int, input().split()))
	(a, b, x, y, n) = (lst[0], lst[1], lst[2], lst[3], lst[4])
	if a > x:
		if n > a - x:
			n = n - a + x
			a = x
			if n > b - y:
				b = y
			else:
				b -= n
		else:
			a -= n
	ans1 = a * b
	(a, b, x, y, n) = (lst[0], lst[1], lst[2], lst[3], lst[4])
	if b > y:
		if n > b - y:
			n = n - b + y
			b = y
			if n > a - x:
				a = x
			else:
				a -= n
		else:
			b -= n
	ans2 = a * b
	print(min(ans1, ans2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	else:
		(ca, cb) = (a - x, b - y)
		M = int(1e+19)
		(l, r) = (a, b)
		f1 = ca >= n and cb >= n
		f2 = ca >= n and cb < n
		f3 = ca < n and cb >= n
		if f1:
			M = min(M, (a - n) * b, a * (b - n))
		elif f2:
			tmp = n - cb
			M = min(M, (a - n) * b, (a - tmp) * y)
		elif f3:
			tmp = n - ca
			M = min(M, x * (b - tmp), a * (b - n))
		else:
			tmp1 = n - ca
			tmp2 = n - cb
			M = min(M, x * (b - tmp1), (a - tmp2) * y)
		print(M)


import sys

def slv():
	if a - x + b - y <= n:
		return x * y
	val1 = max(x, a - n)
	val2 = max(y, b - n)
	if val1 < val2:
		return val1 * max(0, b - max(0, n - (a - x)))
	else:
		return val2 * max(0, a - max(0, n - (b - y)))
t = int(sys.stdin.readline())
ans_arr = []
for i in range(t):
	[a, b, x, y, n] = [int(j) for j in sys.stdin.readline().split()]
	ans = slv()
	ans_arr.append(str(ans))
print('\n'.join(ans_arr))


import os
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		(a, b, x, y, n) = map(int, input().split())
		(a1, a2) = (a, a)
		(b1, b2) = (b, b)
		(n1, n2) = (n, n)
		(ans1, ans2) = (0, 0)
		m1 = min(n1, a1 - x)
		a1 -= m1
		n1 -= m1
		if n1 > 0:
			b1 -= min(n1, b1 - y)
		ans1 = a1 * b1
		m2 = min(n2, b2 - y)
		b2 -= m2
		n2 -= m2
		if n2 > 0:
			a2 -= min(n2, a2 - x)
		ans2 = a2 * b2
		print(min(ans1, ans2))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	d1 = max(x, a - n)
	d2 = max(y, b - (n - (a - d1)))
	f1 = d1 * d2
	d1 = max(y, b - n)
	d2 = max(x, a - (n - (b - d1)))
	f2 = d1 * d2
	print(min(f1, f2))


test = int(input())
for w in range(0, test):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	n1 = n
	t1 = min(a - x, n)
	a = a - t1
	n = n - t1
	t2 = min(b - y, n)
	b = b - t2
	n = n - t2
	ans1 = a * b
	t3 = min(b1 - y1, n1)
	b1 = b1 - t3
	n1 = n1 - t3
	t4 = min(a1 - x1, n1)
	a1 = a1 - t4
	n1 = n1 - t4
	ans2 = a1 * b1
	print(min(ans1, ans2))


import sys
input = sys.stdin.readline
INF = float('inf')
tc = int(input())
for _ in range(tc):
	(a, b, x, y, n) = map(int, input().split())
	tmp1 = 0
	tmp2 = 0
	if a - x - n >= 0:
		tmp1 = a - n
	else:
		tmp1 = x
	if b - y - n >= 0:
		tmp2 = b - n
	else:
		tmp2 = y
	min_ = [a, x] if tmp1 <= tmp2 else [b, y]
	max_ = [a, x] if tmp1 > tmp2 else [b, y]
	if min_[0] - min_[1] >= n:
		min_[0] -= n
		n = 0
	else:
		n -= min_[0] - min_[1]
		min_[0] = min_[1]
	if n != 0:
		if max_[0] - max_[1] >= n:
			max_[0] -= n
		else:
			max_[0] = max_[1]
	print(min_[0] * max_[0])


t = int(input())
while t > 0:
	(a, b, x, y, n) = [int(x) for x in input().split()]
	dn = n
	(a1, b1, a2, b2) = (0, 0, 0, 0)
	if a - n < x:
		a1 = x
		n = n - (a - x)
		if b - n < y:
			b1 = y
		else:
			b1 = b - n
	else:
		a1 = a - n
		b1 = b
	n = dn
	if b - n < y:
		b2 = y
		n = n - (b - y)
		if a - n < x:
			a2 = x
		else:
			a2 = a - n
	else:
		b2 = b - n
		a2 = a
	print(min(a1 * b1, a2 * b2))
	t -= 1


import math

def print_result(ans):
	print(ans)

def solve(a, b, x, y, n):
	pd1 = 0
	if a - x >= n:
		pd1 = (a - n) * b
	else:
		pd1 = x * (b - min(b - y, n - (a - x)))
	pd2 = 0
	if b - y >= n:
		pd2 = (b - n) * a
	else:
		pd2 = y * (a - min(a - x, n - (b - y)))
	return min(pd1, pd2)
t = int(input())
for i in range(1, t + 1):
	(a, b, x, y, n) = list(map(int, input().split()))
	ans = solve(a, b, x, y, n)
	print_result(ans)


def mi(k, l, m, n, o):
	if k - m >= o:
		k = k - o
		o = 0
	else:
		va = m
		o -= k - m
		k = va
	if l - n <= o:
		l = n
	else:
		l = l - o
		o = 0
	return k * l
for j in range(int(input())):
	(a, b, c, d, e) = map(int, input().split())
	mi1 = min(mi(a, b, c, d, e), mi(b, a, d, c, e))
	print(mi1)


from math import ceil
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	i = a - x
	j = b - y
	ans = float('inf')
	if i >= n:
		ans = min(ans, (a - n) * b)
	else:
		ans = min(ans, (a - i) * (b - min(j, n - i)))
	if j >= n:
		ans = min(ans, a * (b - n))
	else:
		ans = min(ans, (a - min(i, n - j)) * (b - j))
	print(ans)


T = int(input())
while T > 0:
	(a, b, x, y, n) = map(int, input().split())
	tt = a - x
	res = a * b
	if tt >= n:
		res = min(res, (a - n) * b)
	else:
		res = min(res, x * max(y, b - (n - (a - x))))
	zz = b - y
	if zz >= n:
		res = min(res, a * (b - n))
	else:
		res = min(res, y * max(x, a - (n - (b - y))))
	print(res)
	T -= 1


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ax = a - x
	by = b - y
	if a - min(ax, n) <= b - min(by, n):
		a -= min(ax, n)
		n -= min(ax, n)
		b -= min(by, n)
	else:
		b -= min(by, n)
		n -= min(by, n)
		a -= min(ax, n)
	print(a * b)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(a, b, x, y) = (a, b, x, y) if a >= b else (b, a, y, x)
	(aa, bb, xx, yy, nn) = (a, b, x, y, n)
	e = min(b - y, n)
	b -= e
	n -= e
	e = min(a - x, n)
	a -= e
	n -= e
	e = min(aa - xx, nn)
	aa -= e
	nn -= e
	e = min(bb - yy, nn)
	bb -= e
	nn -= e
	print(min(aa * bb, a * b))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	(p, q, l, u, m) = (a, b, x, y, n)
	if a >= b:
		t = b - y
		if t >= n:
			b = b - n
		else:
			b = y
			n -= t
			r = a - n
			if r <= x:
				a = x
			else:
				a = r
		s = p - l
		if s >= m:
			p = p - m
		else:
			p = l
			m -= s
			v = q - m
			if v <= u:
				q = u
			else:
				q = v
	print(min(a * b, p * q))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + (b - y) <= n:
		print(x * y)
	else:
		tempa = a
		tempb = b
		a = max(a - n, x)
		b = max(b - (n - (tempa - a)), y)
		ans = b * a
		a = tempa
		b = tempb
		b = max(b - n, y)
		a = max(a - (n - (tempb - b)), x)
		ans = min(ans, a * b)
		print(ans)


import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input = sys.stdin.readline
mo = 10 ** 9 + 7

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

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

def sin():
	return input()

def inin():
	return int(input())
for _ in range(inin()):
	(a, b, x, y, n) = cin()
	(p, q, r, s, t) = (a, b, x, y, n)
	(p1, p2) = (0, 0)
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	elif a == b:
		if x > y:
			(x, y) = (y, x)
	d1 = a - x
	d2 = b - y
	if d1 >= n:
		a = a - n
		n = 0
	else:
		a = x
		n -= d1
	if n:
		if d2 >= n:
			b = b - n
			n = 0
		else:
			b = y
			n = d2
	p1 = a * b
	(a, b, x, y, n) = (p, q, r, s, t)
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	elif a == b:
		if x > y:
			(x, y) = (y, x)
	d1 = a - x
	d2 = b - y
	if d1 >= n:
		a = a - n
		n = 0
	else:
		a = x
		n -= d1
	if n:
		if d2 >= n:
			b = b - n
			n = 0
		else:
			b = y
			n = d2
	p2 = a * b
	print(min(p1, p2))


def ab(a, b, x, y, n):
	if b - y < n:
		a -= n - (b - y)
		b = y
	else:
		b -= n
	return a * b

def ba(a, b, x, y, n):
	if a - x < n:
		b -= n - (a - x)
		a = x
	else:
		a -= n
	return a * b
test = int(input())
for i in range(test):
	(a, b, x, y, n) = [int(q) for q in input().split(' ')]
	if n >= a - x + (b - y):
		print(x * y)
	else:
		print(min(ab(a, b, x, y, n), ba(a, b, x, y, n)))


from math import inf
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	tmp = min(a - x, n)
	rem = n - tmp
	aa = a - tmp
	bb = b - min(b - y, rem)
	ans = aa * bb
	tmp = min(b - y, n)
	rem = n - tmp
	bb = b - tmp
	aa = a - min(a - x, rem)
	ans = min(ans, aa * bb)
	print(ans)


from sys import exit
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	al = a - x
	bl = b - y
	ta = a
	tb = b
	tn = n
	tal = al
	tbl = bl
	c = min(al, n)
	a -= c
	n -= c
	if n:
		if b - n <= y:
			b = y
		else:
			b -= n
	ans1 = a * b
	c = min(tbl, tn)
	tb -= c
	tn -= c
	if tn:
		if ta - tn <= x:
			ta = x
		else:
			ta -= tn
	ans2 = ta * tb
	print(min(ans1, ans2))


m = int(input())
for i in range(m):
	axbyn = input().split()
	a = int(axbyn[0])
	b = int(axbyn[1])
	x = int(axbyn[2])
	y = int(axbyn[3])
	n = int(axbyn[4])
	a1 = a - x
	b1 = b - y
	if a - min(n, a1) > b - min(n, b1):
		if n > b1:
			n -= b1
			b -= b1
			a -= min(a1, n)
		else:
			b -= n
	elif n > a1:
		n -= a1
		a -= a1
		b -= min(b1, n)
	else:
		a -= n
	print(a * b)


def push_to_min(a, b, x, y, n):
	first = 0
	second = 0
	temp_a = a
	temp_b = b
	temp_n = n
	a -= min(n, a - x)
	n -= temp_a - a
	if n > 0:
		b -= min(n, b - y)
	first = a * b
	n = temp_n
	a = temp_a
	b = temp_b
	b -= min(n, b - y)
	n -= temp_b - b
	if n > 0:
		a -= min(n, a - x)
	second = a * b
	return min(first, second)
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(push_to_min(a, b, x, y, n))


tests = int(input())
for i in range(tests):
	vals = input().split(' ')
	a = int(vals[0])
	b = int(vals[1])
	x = int(vals[2])
	y = int(vals[3])
	n = int(vals[4])
	a_temp = a
	b_temp = b
	if a - x <= n:
		new_n = n - (a - x)
		a = x
		if b - y <= new_n:
			b = y
		else:
			b = b_temp - new_n
	elif a - x > n:
		a = a_temp - n
		b = b_temp
	p1 = a * b
	if b_temp - y <= n:
		new_n = n - (b_temp - y)
		b = y
		if a_temp - x <= new_n:
			a = x
		else:
			a = a_temp - new_n
	elif b_temp - y > n:
		a = a_temp
		b = b_temp - n
	p2 = a * b
	print(min(p1, p2))


t = int(input())
for _ in range(t):
	result = 0
	(a, b, x, y, n) = list(map(int, input().split()))
	if a - n >= x and b - n >= y:
		result = min((a - n) * b, a * (b - n))
	elif a - n < x and b - n < y:
		a1 = a - (a - x)
		if n - (a - x) > b - y:
			b1 = b - (b - y)
		else:
			b1 = b - (n - (a - x))
		b2 = b - (b - y)
		if n - (b - y) > a - x:
			a2 = a - (a - x)
		else:
			a2 = a - (n - (b - y))
		result = min(a1 * b1, a2 * b2)
	elif a - n < x:
		a1 = a - (a - x)
		b1 = b - (n - (a - x))
		a2 = a
		b2 = b - n
		result = min(a1 * b1, a2 * b2)
	elif b - n < y:
		b1 = b - (b - y)
		a1 = a - (n - (b - y))
		a2 = a - n
		b2 = b
		result = min(a1 * b1, a2 * b2)
	print(result)


for I in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	diffa = a - x
	diffb = b - y
	possible_a = max(x, a - n)
	possible_b = max(y, b - n)
	if possible_a >= possible_b:
		cost = b - possible_b
		first_num = possible_b
		second_num = a
		tag = 'a'
	else:
		cost = a - possible_a
		first_num = possible_a
		second_num = b
		tag = 'b'
	rem_n = n - cost
	if tag == 'a':
		second_num = max(x, second_num - rem_n)
	else:
		second_num = max(y, second_num - rem_n)
	print(first_num * second_num)


def solveTestCase(a, b, x, y, n):
	prod1 = 1
	prod2 = 1
	if a - n >= x:
		prod1 = (a - n) * b
	elif b - (n - (a - x)) >= y:
		prod1 = x * (b - (n - (a - x)))
	else:
		prod1 = x * y
	if b - n >= y:
		prod2 = (b - n) * a
	elif a - (n - (b - y)) >= x:
		prod2 = y * (a - (n - (b - y)))
	else:
		prod2 = y * x
	return min(prod1, prod2)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(solveTestCase(a, b, x, y, n))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().rstrip().split()))
	if a - x + b - y <= n:
		print(x * y)
		continue
	ma = max(a - n, x)
	mb = max(b - n, y)
	pa = ma * (b - (n - (a - ma)))
	pb = mb * (a - (n - (b - mb)))
	print(min(pa, pb))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split(' '))
	k = (a - min(a - x, n)) * (b - min(b - y, n - min(a - x, n)))
	p = (b - min(b - y, n)) * (a - min(a - x, n - min(b - y, n)))
	print(min(k, p))


t = int(input())
for k in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a - min(n, a - x)
	n1 = n - (a - a1)
	b1 = b - min(n1, b - y)
	b2 = b - min(n, b - y)
	n2 = n - (b - b2)
	a2 = a - min(n2, a - x)
	print(min(a1 * b1, a2 * b2))


def getRes(a, b, x, y, n):
	d1 = a - x
	d2 = b - y
	c1 = min(d1, n)
	a -= c1
	n -= c1
	c2 = min(d2, n)
	b -= c2
	n -= c2
	ans = a * b
	return ans

def minProduct(a, b, x, y, n):
	ans = min(getRes(a, b, x, y, n), getRes(b, a, y, x, n))
	print(ans)
	return
tc = int(input())
for _ in range(0, tc):
	(a, b, x, y, n) = input().split()
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	minProduct(a, b, x, y, n)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	min_ = a * b
	n1 = n
	n2 = n
	z = b - y
	if z >= n:
		min_ = min(min_, a * (b - n))
	else:
		n1 -= z
		min_ = min(min_, max(x, a - n1) * y)
	z = a - x
	if z >= n:
		min_ = min(min_, (a - n) * b)
	else:
		n2 -= z
		min_ = min(min_, max(y, b - n2) * x)
	print(min_)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(a, b, x, y, n) = map(int, sys.stdin.readline().split())
	(a2, b2, n2) = (a, b, n)
	if a - x <= n:
		n -= a - x
		a = x
	else:
		a -= n
		n = 0
	if b - y <= n:
		n -= b - y
		b = y
	else:
		b -= n
		n = 0
	if b2 - y <= n2:
		n2 -= b2 - y
		b2 = y
	else:
		b2 -= n2
		n2 = 0
	if a2 - x <= n2:
		n2 -= a2 - x
		a2 = x
	else:
		a2 -= n2
		n2 = 0
	print(min(a * b, a2 * b2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	A = a
	B = b
	X = x
	Y = y
	N = n
	mn = min(a - x, n)
	a -= mn
	n -= mn
	b -= min(b - y, n)
	mn = min(B - Y, N)
	B -= mn
	N -= mn
	A -= min(A - X, N)
	print(min(a * b, A * B))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	n1 = n
	(i, j) = (a - x, b - y)
	flag = 0
	if i >= j:
		a -= min(n, i)
		n -= min(n, i)
		flag = 1
	else:
		b -= min(n, j)
		n -= min(n, j)
		flag = 2
	if n > 0:
		if flag == 1:
			b -= min(n, j)
		else:
			a -= min(n, i)
	ans1 = a * b
	if i < j:
		a1 -= min(n1, i)
		n1 -= min(n1, i)
		flag = 1
	else:
		b1 -= min(n1, j)
		n1 -= min(n1, j)
		flag = 2
	if n1 > 0:
		if flag == 1:
			b1 -= min(n1, j)
		else:
			a1 -= min(n1, i)
	ans2 = a1 * b1
	print(min(ans1, ans2))


def main():
	t = int(input())
	for i in range(t):
		(a, b, x, y, n) = map(int, input().split())
		result = find_min_product(a, b, min_a=x, min_b=y, operations_n=n)
		print(result)

def find_min_product(a, b, min_a, min_b, operations_n):
	assert a >= min_a
	assert b >= min_b
	min_a = max(min_a, a - operations_n)
	min_b = max(min_b, b - operations_n)
	if min_a > min_b:
		(min_a, min_b) = (min_b, min_a)
		(a, b) = (b, a)
	assert min_a <= min_b
	operations_for_a = a - min_a
	a -= operations_for_a
	operations_remain_for_b = operations_n - operations_for_a
	b = max(min_b, b - operations_remain_for_b)
	return a * b
main()


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = float('inf')
	fora = a - x
	forb = b - y
	if n >= fora:
		rem_n = n - fora
		if rem_n >= forb:
			ans = min(x * y, ans)
		else:
			ans = min(x * (b - rem_n), ans)
	else:
		ans = min(ans, (a - n) * b)
	if n >= forb:
		rem_n = n - forb
		if rem_n >= fora:
			ans = min(x * y, ans)
		else:
			ans = min(ans, (a - rem_n) * y)
	else:
		ans = min(ans, (b - n) * a)
	print(ans)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	best = 1e+100
	a1 = a
	b1 = b
	n1 = n
	diff1 = min(n, a - x)
	a1 -= diff1
	n1 -= diff1
	if n1 > 0:
		b1 -= min(n1, b - y)
	best = min(best, a1 * b1)
	diff2 = min(n, b - y)
	b -= diff2
	n -= diff2
	if n > 0:
		a -= min(n, a - x)
	best = min(best, a * b)
	print(best)


for _ in range(int(input())):
	(a1, b1, x1, y1, n1) = map(int, input().split())
	(a, b, x, y, n) = (a1, b1, x1, y1, n1)
	(ans1, ans2, ans3) = [10 ** 9] * 3
	if a - x >= n:
		ans1 = (a - n) * b
	else:
		n = n - (a - x)
		a = x
		if b - y >= n:
			ans1 = a * (b - n)
		else:
			ans1 = a * y
	(a, b, x, y, n) = (a1, b1, x1, y1, n1)
	if b - y >= n:
		ans2 = a * (b - n)
	else:
		n = n - (b - y)
		b = y
		if a - x >= n:
			ans2 = (a - n) * b
		else:
			ans2 = x * y
	(a, b, x, y, n) = (a1, b1, x1, y1, n1)
	if n % 2 == 0:
		if a - x < n // 2:
			n = n - (a - x)
			a = x
			if b - y >= n:
				ans3 = a * (b - n)
			else:
				ans3 = a * y
		elif b - y < n // 2:
			n = n - (b - y)
			b = y
			if a - x >= n:
				ans3 = (a - n) * b
			else:
				ans3 = x * y
		else:
			ans3 = (a - n // 2) * (b - n // 2)
	elif a - x < n // 2:
		n = n - (a - x)
		a = x
		if b - y >= n:
			ans3 = a * (b - n)
		else:
			ans3 = a * y
	elif b - y < n // 2:
		n = n - (b - y)
		b = y
		if a - x >= n:
			ans3 = (a - n) * b
		else:
			ans3 = x * y
	else:
		if a > b and a - x > n // 2:
			a -= 1
		elif a > b and b - y > n // 2:
			b -= 1
		elif b > a and b - y > n // 2:
			b -= 1
		elif b > a and a - x > n // 2:
			a -= 1
		ans3 = (a - n // 2) * (b - n // 2)
	print(min(ans1, ans2, ans3))


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(a, b, x, y, n) = I()
	o = a + b - x - y
	tt = max(0, o - n)
	fx = min(x + tt, a)
	tt -= fx - x
	fb = y
	if tt:
		fb = min(y + tt, b)
	an = fx * fb
	(x, y) = (y, x)
	(a, b) = (b, a)
	tt = max(0, o - n)
	fx = min(x + tt, a)
	tt -= fx - x
	fb = y
	if tt:
		fb = min(y + tt, b)
	an = min(fx * fb, an)
	print(an)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	xOp = a - x
	yOp = b - y
	m1 = min(xOp, n)
	k1 = a - m1
	m2 = min(yOp, n)
	k2 = b - m2
	if k2 <= k1:
		p1 = k2
		if abs(n - m2) > xOp:
			remainingOperations = xOp
		else:
			remainingOperations = n - m2
		p2 = a - remainingOperations
		print(p1 * p2)
	else:
		p1 = k1
		if abs(n - m1) > yOp:
			remainingOperations = yOp
		else:
			remainingOperations = n - m1
		p2 = b - remainingOperations
		print(p1 * p2)


t = int(input())
for test in range(t):
	(a, b, x, y, n) = map(int, input().split())
	j = True
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if j == True:
		if b - n >= y:
			b = b - n
		else:
			n = n - b + y
			b = y
			if a - n >= x:
				a = a - n
			else:
				a = x
		first = a * b
	if j == True:
		(a, b, x, y, n) = (a1, b1, x1, y1, n1)
		if a - n >= x:
			a = a - n
		else:
			n = n - a + x
			a = x
			if b - n >= y:
				b = b - n
			else:
				b = y
		second = a * b
	print(min(first, second))


def min_prod(a: int, b: int, x: int, y: int, n: int):
	res = float('inf')
	diff1 = min(a - x, n)
	range1 = a - diff1
	range2 = b - min(b - y, n - diff1)
	res = min(res, range1 * range2)
	diff2 = min(b - y, n)
	range1 = b - diff2
	range2 = a - min(a - x, n - diff2)
	res = min(res, range1 * range2)
	return res
T = int(input())
for _ in range(T):
	(a, b, x, y, n) = map(int, input().split())
	print(min_prod(a, b, x, y, n))


import sys
import math

def get_ints():
	return map(int, I().split())

def get_list():
	return list(map(int, I().split()))

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

def fun1(a1, b1, x, y):
	if a1 - x >= n:
		a1 -= n
	else:
		if b1 - (n - a1 + x) >= y:
			b1 -= n - a1 + x
		else:
			b1 = y
		a1 = x
	return a1 * b1

def fun2(a, b, x, y):
	if b - y >= n:
		b -= n
	else:
		if a - (n - b + y) >= x:
			a -= n - b + y
		else:
			a = x
		b = y
	return a * b
for k in range(t):
	(a, b, x, y, n) = get_ints()
	print(min(fun1(a, b, x, y), fun2(a, b, x, y)))


import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	mina = min(a - x, n)
	minb = min(b - y, n)
	ans1 = 10 ** 20
	ans2 = 10 ** 20
	ans1 = (a - mina) * max(y, b - (n - mina))
	ans2 = (b - minb) * max(x, a - (n - minb))
	print(min(ans1, ans2))


for _ in range(int(input())):
	(a, b, x, y, n) = (int(i) for i in input().split(' '))
	ans1 = 1
	ans2 = 1
	if b - y <= n:
		c = max(x, a - (n - (b - y)))
		ans1 *= y * c
	else:
		ans1 *= (b - n) * a
	if a - x <= n:
		c = max(y, b - (n - (a - x)))
		ans2 *= x * c
	else:
		ans2 *= (a - n) * b
	print(ans1 if ans2 < 0 else ans2 if ans1 < 0 else min(ans1, ans2))


def solve(a, b, x, y, n):
	if a - x <= n:
		n = n - (a - x)
		fa = x
	else:
		fa = a - n
		n = 0
	if b - y <= n:
		n = n - (b - y)
		fb = y
	else:
		fb = b - n
		n = 0
	return fb * fa
x = int(input())
for z in range(x):
	(a, b, x, y, n) = map(int, input().split())
	c = solve(a, b, x, y, n)
	d = solve(b, a, y, x, n)
	print(min(c, d))


TC = int(input())
while TC > 0:
	(a, b, x, y, n) = list(map(int, input().split()))
	dec1 = min(a - x, n)
	dec2 = min(b - y, n)
	if a - dec1 < b - dec2:
		a -= dec1
		b -= min(b - y, n - dec1)
	else:
		b -= dec2
		a -= min(a - x, n - dec2)
	print(a * b)
	TC -= 1


myList = []
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	if min(max(a - n, x), max(b - n, y)) == x:
		b = max(b - (n - (a - x)), y)
		a = x
		myList.append(a * b)
	elif min(max(a - n, x), max(b - n, y)) == y:
		a = max(a - (n - (b - y)), x)
		b = y
		myList.append(a * b)
	elif min(max(a - n, x), max(b - n, y)) == a - n:
		b = b
		a = a - n
		myList.append(a * b)
	else:
		b = b - n
		a = a
		myList.append(a * b)
for elem in myList:
	print(elem)


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	n1 = n
	d1 = a - x
	d2 = b - y
	a -= min(d1, n)
	n -= min(d1, n)
	if n > 0:
		b -= min(n, d2)
	r1 = a * b
	b1 -= min(d2, n1)
	n1 -= min(d2, n1)
	if n1 > 0:
		a1 -= min(n1, d1)
	r2 = a1 * b1
	print(min(r1, r2))


def ans(a, b, x, y, n):
	temp = b - y
	if temp >= n:
		b -= n
		return a * b
	else:
		n -= temp
		b -= temp
		z = abs(a - x)
		if n > z:
			a -= z
		else:
			a -= n
		return a * b
T = int(input())
for i in range(T):
	(a, b, x, y, n) = map(int, input().strip().split(' '))
	print(min(ans(a, b, x, y, n), ans(b, a, y, x, n)))


t = int(input())
for test in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split(' ')]
	a1 = max(a - n, x)
	b1 = max(b - n, y)
	if a1 < b1:
		b_new = max(b - (n - (a - a1)), y)
		result = a1 * b_new
	else:
		a_new = max(a - (n - (b - b1)), x)
		result = b1 * a_new
	print(result)


from sys import stdin

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

def get_str():
	return stdin.readline().strip()

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

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

def get_array2d(row):
	return [list(map(int, stdin.readline().strip().split())) for _ in range(row)]
T = get_int()
for _ in range(T):
	(A, B, X, Y, N) = get_ints()
	(A1, B1, N1) = (A, B, N)
	d = min(A - X, N)
	A -= d
	N -= d
	d = min(B - Y, N)
	B -= d
	ans = A * B
	(A, B, N) = (A1, B1, N1)
	d = min(B - Y, N)
	B -= d
	N -= d
	d = min(A - X, N)
	A -= d
	ans1 = A * B
	print(min(ans, ans1))


from math import *
t = int(input())
for q in range(t):
	(a, b, x, y, n) = map(int, input().split())

	def do_it(a, b, x, y, n):
		f1 = min(n, a - x)
		a -= f1
		n -= f1
		f2 = min(b - y, n)
		b -= f2
		n -= f2
		return a * b
	res = min(do_it(a, b, x, y, n), do_it(b, a, y, x, n))
	print(res)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a - x + b - y <= n:
		ans = x * y
	else:
		t = min(max(a - n, x), max(b - n, y))
		ans = t * (max(a, b) - max(n - min(a, b) + t, 0))
	print(ans)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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

def iterative(f, stack=[]):

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

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

def integer():
	return int(inp())

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

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

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

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

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

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

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

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

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

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

def solve():
	(a, b, x, y, n) = sep()
	tn = n
	t1 = min(n, a - x)
	n -= t1
	t2 = min(n, b - y)
	temp1 = (a - t1) * (b - t2)
	n = tn
	t1 = min(n, b - y)
	n -= t1
	t2 = min(n, a - x)
	temp2 = (b - t1) * (a - t2)
	print(min(temp1, temp2))
testcase(int(inp()))


def gt():
	return list(map(int, input().split()))
(t,) = gt()
while t:
	t -= 1
	(a, b, x, y, n) = gt()
	n = min(n, a + b - x - y)
	(a1, b1) = (a - (n - min(b - y, n)), b - min(b - y, n))
	(a2, b2) = (a - min(a - x, n), b - (n - min(a - x, n)))
	print(min(a1 * b1, a2 * b2))


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	res = 1e+20
	if n > a - x:
		res = min(res, x * max(b - (n - (a - x)), y))
	if n > b - y:
		res = min(res, y * max(a - (n - (b - y)), x))
	if a - n >= x:
		res = min(res, (a - n) * b)
	if b - n >= y:
		res = min(res, (b - n) * a)
	print(res)


qq = int(input())
for t in range(qq):
	(a, b, x, y, n) = list(map(int, input().split()))
	d1 = a - x
	d2 = b - y
	p = 0
	q = 0
	if d1 < n:
		p = x
		q = max(b - n + d1, y)
	else:
		p = a - n
		q = b
	p1 = p * q
	if d2 < n:
		q = y
		p = max(a - n + d2, x)
	else:
		q = b - n
		p = a
	p2 = p * q
	print(min(p1, p2))


def f(a, b, n):
	return (min(a, n), max(0, min(b, n - min(a, n))))
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	p1 = a - x
	p2 = b - y
	ans1 = f(p1, p2, n)
	ans1 = (a - ans1[0]) * (b - ans1[1])
	ans2 = f(p2, p1, n)
	ans2 = (b - ans2[0]) * (a - ans2[1])
	print(min(ans1, ans2))


import copy
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	fx = a - x
	sx = b - y
	if a == b:
		if fx > sx:
			a -= min(fx, n)
			n -= min(fx, n)
			b -= min(sx, n)
		else:
			b -= min(sx, n)
			n -= min(sx, n)
			a -= min(fx, n)
	elif abs(a - b) <= n:
		if a > b:
			p = a * 1
			q = b * 1
			z = n * 1
			a -= min(fx, n)
			n -= min(fx, n)
			b -= min(sx, n)
			q -= min(sx, z)
			z -= min(sx, z)
			p -= min(fx, z)
			if a * b > p * q:
				a = p * 1
				b = q * 1
		else:
			p = a * 1
			q = b * 1
			z = n * 1
			b -= min(sx, n)
			n -= min(sx, n)
			a -= min(fx, n)
			p -= min(fx, z)
			z -= min(fx, z)
			q -= min(sx, z)
			if a * b > p * q:
				a = p * 1
				b = q * 1
	elif a > b:
		b -= min(sx, n)
		n -= min(sx, n)
		a -= min(fx, n)
	else:
		a -= min(fx, n)
		n -= min(fx, n)
		b -= min(sx, n)
	print(a * b)


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


cases = int(input())
for t in range(cases):
	(a, b, x, y, n) = list(map(int, input().split()))
	if a - x >= n:
		a1 = a - n
		b1 = b
	else:
		a1 = x
		left = n - (a - x)
		b1 = max(y, b - left)
	s1 = a1 * b1
	if b - y >= n:
		b1 = b - n
		a1 = a
	else:
		b1 = y
		left = n - (b - y)
		a1 = max(x, a - left)
	s2 = a1 * b1
	print(min(s1, s2))


t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	(a2, b2, y2, x2, n2) = (a, b, x, y, n)
	f = max(a - n, x)
	n = n + f - a
	s = max(b - n, y)
	ans1 = f * s
	f = max(b2 - n2, x2)
	n2 = n2 + f - b2
	s = max(a2 - n2, y2)
	ans2 = f * s
	print(min(ans1, ans2))


testCases = int(input())
while testCases > 0:
	testCases -= 1
	(a, b, x, y, n) = [int(x) for x in input().split()]
	if max(a - n, x) > max(b - n, y):
		(a, b) = (b, a)
		(x, y) = (y, x)
	p = max(a - n, x)
	n = n - (a - p)
	q = max(b - n, y)
	print(p * q)


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])

def solve(a, b, x, y, n):
	d = min(a - x, n)
	a -= d
	n -= d
	b -= min(b - y, n)
	return a * b
for _ in range(inp()):
	(a, b, x, y, n) = ip()
	ans1 = solve(a, b, x, y, n)
	ans2 = solve(b, a, y, x, n)
	print(min(ans1, ans2))


def prior_a(a, b, x, y, n):
	if x <= a - n:
		a = a - n
	else:
		n = n - a + x
		a = x
		if y <= b - n:
			b = b - n
		else:
			b = y
	return a * b

def prior_b(a, b, x, y, n):
	if y <= b - n:
		b = b - n
	else:
		n = n - b + y
		b = y
		if x <= a - n:
			a = a - n
		else:
			a = x
	return a * b
for _ in range(int(input())):
	ls1 = [int(i) for i in input().split()]
	a = ls1[0]
	b = ls1[1]
	x = ls1[2]
	y = ls1[3]
	n = ls1[4]
	k1 = prior_a(a, b, x, y, n)
	k2 = prior_b(a, b, x, y, n)
	print(min(k1, k2))


import sys

def solve(a, b, x, y, n):
	amin = max(x, a - n)
	bmin = max(y, b - n)
	if amin < bmin:
		n -= a - amin
		a = amin
		b = max(y, b - n)
	else:
		n -= b - bmin
		b = bmin
		a = max(x, a - n)
	return a * b
IN = [x.strip() for x in sys.stdin.readlines()]
T = int(IN[0])
cur = 0
for ti in range(T):
	(a, b, x, y, n) = [int(x) for x in IN[cur + 1].split(' ')]
	res = solve(a, b, x, y, n)
	print(res)
	cur += 1


import math
import re
import itertools
import copy
import time
import sys

def input_linear(lamb=lambda x: int(x), seperator=' '):
	return map(lamb, input().split(seperator))

def input_array(lamb=lambda x: int(x), seperator=' '):
	return list(map(lamb, input().split(seperator)))

def input_matrix(rows, lamb=lambda x: int(x), seperator=' '):
	tmp_matrix = []
	for i in range(rows):
		tmp_matrix.append(input_array(lamb, seperator))
	return tmp_matrix

def input_graph_al_pair(vertices, lines, lamb=lambda x: int(x), seperator=' ', directional=False, remove_dup=False):
	temp_matrix = [x[:] for x in [[]] * vertices]
	if not directional:
		if not remove_dup:
			for i in range(lines):
				(ina, inb) = input_linear(lamb, seperator)
				temp_matrix[ina].append(inb)
				temp_matrix[inb].append(ina)
		else:
			for i in range(lines):
				(ina, inb) = input_linear(lamb, seperator)
				if inb not in temp_matrix[ina]:
					temp_matrix[ina].append(inb)
				if ina not in temp_matrix[inb]:
					temp_matrix[inb].append(ina)
		return temp_matrix
	else:
		if not remove_dup:
			for i in range(lines):
				(ina, inb) = input_linear(lamb, seperator)
				temp_matrix[ina].append(inb)
		else:
			for i in range(lines):
				(ina, inb) = input_linear(lamb, seperator)
				if inb not in temp_matrix[ina]:
					temp_matrix[ina].append(inb)
		return temp_matrix
for _ in range(int(input())):
	(a, b, x, y, n) = input_linear()
	cnt_a = max(a - n, x)
	nd = n - (a - cnt_a)
	cnt_b = max(b - nd, y)
	nt_b = max(b - n, y)
	nd2 = n - (b - nt_b)
	nt_a = max(a - nd2, x)
	print(min(cnt_a * cnt_b, nt_a * nt_b))


def solve(p1, p2, n):
	if p1[0] - p1[1] >= n:
		p1[0] -= n
	else:
		n -= p1[0] - p1[1]
		p1[0] = p1[1]
		p2[0] = p2[0] - n if p2[0] - p2[1] >= n else p2[1]
	return (p1[0], p2[0])
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	res1 = solve([a, x], [b, y], n)
	res2 = solve([b, y], [a, x], n)
	res = res1 if min(res1) < min(res2) else res2
	print(res[0] * res[1])


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	p = a
	q = b
	c = n
	if n < p - x:
		p -= n
		n = 0
	else:
		s = p - x
		p -= s
		n -= s
	if n > 0:
		s = q - y
		if n < s:
			q -= n
		else:
			q -= s
	ans = p * q
	p = a
	q = b
	n = c
	if n < q - y:
		q -= n
		n = 0
	else:
		s = q - y
		q -= s
		n -= s
	if n > 0:
		s = p - x
		if n < s:
			p -= n
		else:
			p -= s
	ans = min(ans, p * q)
	print(ans)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = (int(x) for x in input().split())
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if b - y >= n:
		print(a * (b - n))
	elif a + b - x - y >= n:
		temp1 = (a - n + b - y) * y
		if a - x >= n:
			temp2 = (a - n) * b
		else:
			temp2 = x * (b - n + a - x)
		print(min(temp1, temp2))
	else:
		print(x * y)


from sys import stdin, stdout
input = stdin.buffer.readline

def f(a, b, x, y, n):
	(a, n) = (a - min(n, a - x), n - min(n, a - x))
	(b, n) = (b - min(n, b - y), n - min(n, b - y))
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = f(a, b, x, y, n)
	(a, b, x, y) = (b, a, y, x)
	ans = min(ans, f(a, b, x, y, n))
	print(ans)


import sys
INP = lambda : sys.stdin.readline().strip()
INT = lambda : int(INP())
MAP = lambda : map(int, INP().split())
ARR = lambda : [int(i) for i in INP().split()]

def JOIN(arr, x=' '):
	return x.join([str(i) for i in arr])

def EXIT(x='NO'):
	print(x)
	exit()
for _ in range(INT()):
	(a, b, x, y, n) = MAP()
	asub = min(n, a - x)
	bsub = min(n - asub, b - y)
	ans1 = (a - asub) * (b - bsub)
	(a, b, x, y) = (b, a, y, x)
	asub = min(n, a - x)
	bsub = min(n - asub, b - y)
	ans2 = (a - asub) * (b - bsub)
	print(min(ans1, ans2))


def least(num, sub, lim):
	if num - sub >= lim:
		return num - sub
	else:
		return lim
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	min_a = least(a, n, x)
	min_b = least(b, n, y)
	first = 0
	second = 0
	if min_a <= min_b:
		first = min_a
		n -= abs(a - min_a)
		second = least(b, n, y)
		print(first * second)
	else:
		first = min_b
		n -= abs(b - min_b)
		second = least(a, n, x)
		print(first * second)


def find(a, b, x, y, n):
	if a - x <= n:
		n -= a - x
		a = x
		if b - y <= n:
			b = y
		else:
			b -= n
		return a * b
	else:
		a -= n
		return a * b

def find_ans(a, b, x, y, n):
	ans = 1e+100
	ans = min(find(a, b, x, y, n), find(b, a, y, x, n))
	print(ans)
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	find_ans(a, b, x, y, n)


for _ in range(int(input())):
	(a, b, x, y, k) = map(int, input().split())
	da = max(x, a - k)
	db = max(y, b - (k - (a - da)))
	f = da * db
	db = max(y, b - k)
	da = max(x, a - (k - (b - db)))
	s = db * da
	print(min(f, s))


import math

def shrey():
	(a, b, x, y, n) = map(int, input().split())
	ans = 0
	s1 = a
	s2 = b
	m = n
	p1 = 0
	p2 = 0
	p1 = s1 - x
	if p1 <= m:
		m -= p1
		s1 -= p1
	else:
		p1 = m
		m = 0
		s1 -= p1
	p2 = s2 - y
	if p2 <= m:
		m -= p2
		s2 -= p2
	else:
		p2 = m
		m = 0
		s2 -= p2
	ans = s1 * s2
	ans1 = 0
	res1 = 0
	ans1 = b - y
	if ans1 <= n:
		n -= ans1
		b -= ans1
	else:
		ans1 = n
		n = 0
		b -= ans1
	res1 = a - x
	if res1 <= n:
		n -= res1
		a -= res1
	else:
		res1 = n
		n = 0
		a -= res1
	ans = min(a * b, ans)
	print(ans)
T = input()
T = int(T)
for q in range(1, T + 1):
	shrey()


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a > b:
		(a, b, x, y) = (b, a, y, x)
	if a == b and x > y:
		(x, y) = (y, x)
	if a - n >= x:
		a1 = a - n
	else:
		a1 = x
	if b - n >= y:
		b1 = b - n
	else:
		b1 = y
	if b1 < a1:
		(a, b, x, y) = (b, a, y, x)
	if a - n >= x:
		a -= n
	else:
		if b - (n - (a - x)) >= y:
			b = b - (n - (a - x))
		else:
			b = y
		a = x
	print(a * b)


T = int(input())
for t in range(T):
	(a, b, x, y, n) = [int(s) for s in input().split()]
	steps = a - x + (b - y)
	if steps <= n:
		print(x * y)
	else:
		options = []
		if a - n >= x:
			options.append((a - n) * b)
		else:
			options.append(x * (a + b - n - x))
		if b - n >= y:
			options.append((b - n) * a)
		else:
			options.append(y * (a + b - n - y))
		print(min(options))


t = int(input())
for p in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(p, q, r, s, m) = (a, b, x, y, n)
	ans = 0
	if a - x <= n:
		n -= a - x
		a = x
	else:
		a = a - n
		n = 0
	if n > 0:
		if b - y <= n:
			n -= b - y
			b = y
		else:
			b = b - n
			n = 0
	ans = a * b
	if q - s <= m:
		m -= q - s
		q = s
	else:
		q = q - m
		m = 0
	if m > 0:
		if p - r <= m:
			m -= p - r
			p = r
		else:
			p = p - m
			m = 0
	ans = min(ans, p * q)
	print(ans)


def solve():
	(a, b, x, y, n) = list(map(int, input().split()))
	t1 = max(x, a - n)
	t2 = max(y, b - n)
	if t1 < t2:
		n -= a - t1
		a = t1
		b = max(y, b - n)
	else:
		n -= b - t2
		b = t2
		a = max(x, a - n)
	print(a * b)
ct = int(input())
while ct > 0:
	solve()
	ct -= 1


import os
import sys
from io import BytesIO, IOBase

def solution(a, b, x, y, n):
	if a == x and b == y:
		write(a * b)
		return
	dx = a - x
	dy = b - y
	if dx + dy <= n:
		write(x * y)
		return
	(a1, b1) = (a, b)
	n1 = n
	res1 = float('inf')
	if dx <= n1:
		a1 -= dx
		n1 -= dx
	else:
		a1 -= n1
		n1 = 0
	res1 = min(res1, a1 * b1)
	if dy <= n1:
		b1 -= dy
		n1 -= dy
	else:
		b1 -= n1
	res1 = min(res1, a1 * b1)
	(a1, b1) = (a, b)
	n1 = n
	res2 = float('inf')
	if dy <= n1:
		b1 -= dy
		n1 -= dy
	else:
		b1 -= n1
		n1 = 0
	res2 = min(res2, a1 * b1)
	if dx <= n1:
		a1 -= dx
		n1 -= dx
	else:
		a1 -= n1
	res2 = min(res2, a1 * b1)
	write(min(res1, res2))

def main():
	for _ in range(r_int()):
		(a, b, x, y, n) = r_array()
		solution(a, b, x, y, n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

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

def r_int():
	return int(input())
main()


def f1(a, b, x, y, n):
	d = min(a - x, n)
	a -= d
	n -= d
	d = min(b - y, n)
	b -= d
	n -= d
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	print(min(f1(a, b, x, y, n), f1(b, a, y, x, n)))


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
for _ in range(int(stdin.readline())):
	(a, b, x, y, n) = map(int, stdin.readline().strip().split())
	n1 = n2 = n
	v = min(a - x, n1)
	n1 -= v
	d = min(b - y, n1)
	n1 -= d
	c = min(b - y, n2)
	n2 -= c
	g = min(a - x, n2)
	n2 -= g
	print(min((a - v) * (b - d), (b - c) * (a - g)))


cases = int(input())
for i in range(cases):
	(a, b, x, y, n) = map(int, input().split())
	difa = a - x
	difb = b - y
	mya = a
	myb = b
	myn = n
	if difa >= n:
		mya = a - n
	first = mya * b
	mya = a
	myb = b
	if difb >= n:
		myb = b - n
	second = a * myb
	mya = a
	myb = b
	if difa < n:
		mya = x
		myn = n - difa
	if difb >= myn:
		myb = b - myn
	else:
		myb = y
	third = mya * myb
	mya = a
	myb = b
	if difb < n:
		myb = y
		myn = n - difb
	if difa >= myn:
		mya = a - myn
	else:
		mya = x
	fourth = mya * myb
	print(min(first, second, third, fourth))


t = int(input())
while t > 0:
	t = t - 1
	q = input().split()
	a = int(q[0])
	b = int(q[1])
	x = int(q[2])
	y = int(q[3])
	n = int(q[4])
	x1 = 0
	x2 = 0
	if a + b - x - y <= n:
		print(x * y)
	else:
		x = max(x, a - n)
		y = max(y, b - n)
		print(min(y * (a + b - n - y), x * (a + b - n - x)))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	options = []
	a2 = max(a - n, x)
	b2 = max(b - (n - (a - a2)), y)
	options.append(a2 * b2)
	b2 = max(b - n, y)
	a2 = max(a - (n - (b - b2)), x)
	options.append(a2 * b2)
	print(min(options))


for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	prod = 0
	la = []
	t1 = max(a - n, x)
	leftn = n - (a - t1)
	t2 = max(b - leftn, y)
	t3 = max(b - n, y)
	leftn = n - (b - t3)
	t4 = max(a - leftn, x)
	print(min(t1 * t2, t3 * t4))


ct = input()
for line in range(int(ct)):
	line = [int(i) for i in input().split()]
	a = line[0]
	b = line[1]
	aMin = line[2]
	bMin = line[3]
	n = line[4]
	if max(a - n, aMin) > max(b - n, bMin):
		bFin = b - min(b - bMin, n)
		n = n - (b - bFin)
		aFin = a - min(n, a - aMin)
		print(aFin * bFin)
	else:
		aFin = a - min(a - aMin, n)
		n = n - (a - aFin)
		bFin = b - min(n, b - bMin)
		print(aFin * bFin)


import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	first = a - x
	second = b - y
	temp_n = n
	can_a = min(first, temp_n)
	temp_a = a - can_a
	temp_n -= can_a
	can_b = min(second, temp_n)
	temp_b = b - can_b
	temp_n -= can_b
	ans = temp_a * temp_b
	can_b = min(second, n)
	temp_b = b - can_b
	n -= can_b
	can_a = min(first, n)
	temp_a = a - can_a
	n -= can_a
	ans = min(ans, temp_a * temp_b)
	print(ans)


def sub(ar, br, xx, yy, nn):
	aa = max(ar - nn, xx)
	nn = nn + aa - ar
	bb = max(br - nn, yy)
	return aa * bb
for ii in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(sub(a, b, x, y, n), sub(b, a, y, x, n)))


def solve():
	res = 10 ** 30
	(a, b, x, y, n) = map(int, input().split())
	if n > a - x + (b - y):
		print(x * y)
		return
	Ac = min(a - x, n)
	Bc = n - Ac
	res = min(res, (a - Ac) * (b - Bc))
	Bd = min(b - y, n)
	Ad = n - Bd
	res = min(res, (a - Ad) * (b - Bd))
	print(res)
	return
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for tt in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split(' ')]
	if a < b:
		(t1, t2) = (a, x)
		(a, x) = (b, y)
		(b, y) = (t1, t2)
	(a1, b1) = (a, b)
	if b - n >= y:
		b1 = b - n
	else:
		b1 = y
		a1 -= y - (b - n)
		if a1 < x:
			a1 = x
	ans1 = a1 * b1
	(a2, b2) = (a, b)
	if a - n >= x:
		a2 = a - n
	else:
		a2 = x
		b2 -= x - (a - n)
		if b2 < y:
			b2 = y
	ans2 = a2 * b2
	print(min(ans1, ans2))


from sys import *
t = int(stdin.readline())
for _ in range(t):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	a1 = a
	b1 = b
	m = n
	if b - y <= n:
		n -= b - y
		b = y
		if a - x <= n:
			n -= a - x
			a = x
		else:
			a -= n
			n = 0
	else:
		b -= n
		n = 0
	if a1 - x <= m:
		m -= a1 - x
		a1 = x
		if b1 - y <= m:
			m -= b1 - y
			b1 = y
		else:
			b1 -= m
			m = 0
	else:
		a1 -= m
		m = 0
	print(min(a * b, a1 * b1))


import sys, math, heapq, collections, itertools, bisect
sys.setrecursionlimit(101000)

def solve(a, b, x, y, n):
	diffa = a - x
	diffb = b - y
	first = min(diffb, n)
	b -= first
	n -= first
	second = min(diffa, n)
	a -= second
	n -= second
	return a * b
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))


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

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

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for T in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 0
	ta = a
	tb = b
	tn = n
	if a < b:
		if a - x > n:
			a = a - n
		else:
			n = n - (a - x)
			a = x
			if b - y > n:
				b = b - n
				n = 0
			else:
				n = n - (b - y)
				b = y
	elif b - y > n:
		b = b - n
	else:
		n = n - (b - y)
		b = y
		if a - x > n:
			a = a - n
			n = 0
		else:
			n = n - (a - x)
			a = x
	ans = a * b
	a = ta
	b = tb
	n = tn
	if a < b:
		if b - y > n:
			b = b - n
		else:
			n = n - (b - y)
			b = y
			if a - x > n:
				a = a - n
				n = 0
			else:
				n = n - (a - x)
				a = x
	elif a - x > n:
		a = a - n
	else:
		n = n - (a - x)
		a = x
		if b - y > n:
			b = b - n
			n = 0
		else:
			n = n - (b - y)
			b = y
	ans = min(ans, a * b)
	print(ans)


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	p = a * b
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	n1 = n
	if a1 - n1 < x1:
		n1 -= a1 - x1
		a1 = x1
		b1 = max(y1, b1 - n1)
	else:
		a1 -= n1
	p = min(p, a1 * b1)
	if b - n < y:
		n -= b - y
		b = y
		a = max(x, a - n)
	else:
		b -= n
	p = min(p, a * b)
	print(p)


import sys
from collections import defaultdict
name = sys.stdin.read()
jobGrid = []
isJob = True
row = []
grid = name.split('\n')
grid = grid[:-1]
number_of_cases = int(grid[0])
for i in range(1, number_of_cases + 1):
	case = [int(x) for x in grid[i].split(' ')]
	a = int(case[0])
	b = int(case[1])
	x = int(case[2])
	y = int(case[3])
	n = int(case[4])
	aN = max(a - n, x)
	bN = max(b - n, y)
	winner = ''
	if bN < aN:
		winner = 'b'
	else:
		winner = 'a'
	if winner == 'a':
		candeduct = n - (a - x)
		if candeduct > 0:
			finala = x
			leftover = n - (a - x)
			finalb = max(b - leftover, y)
			answer = finala * finalb
			print(answer)
		else:
			finala = a - n
			finalb = b
			answer = finala * finalb
			print(answer)
	elif winner == 'b':
		candeduct = n - (b - y)
		if candeduct > 0:
			finalb = y
			leftover = n - (b - y)
			finala = max(a - leftover, x)
			answer = finalb * finala
			print(answer)
		else:
			finalb = b - n
			finala = a
			answer = finala * finalb
			print(answer)


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, m) = (a, b, x, y, n)
	if 1:
		if a - x <= n:
			n = n - (a - x)
			a = x
		else:
			a = a - n
			n = 0
		if b - y <= n:
			n = n - (b - y)
			b = y
		else:
			b = b - n
			n = 0
		c = a * b
	if 1:
		if b1 - y1 <= m:
			m = m - (b1 - y1)
			b1 = y1
		else:
			b1 = b1 - m
			m = 0
		if a1 - x1 <= m:
			m = m - (a1 - x1)
			a1 = x1
		else:
			a1 = a1 - m
			m = 0
		d = a1 * b1
	print(min(c, d))


import sys, threading
from collections import defaultdict, Counter
input = sys.stdin.readline

def rl(type):
	return [type(w) for w in input().split()]

def reverse(arr):
	return arr[-1::-1]

def mod(a, m):
	return (a % m + m) % m

def create_graph(n):
	graph = {}
	for _ in range(n):
		(x, y) = map(int, input().split())
		graph[x].append(y)
		graph[y].append(x)
	return graph

def main():
	for _ in range(int(input())):
		(a, b, x, y, n) = map(int, input().split())
		a1 = max(x, a - n)
		b1 = max(y, b - (n - (a - a1)))
		b2 = max(y, b - n)
		a2 = max(x, a - (n - (b - b2)))
		print(min(a1 * b1, a2 * b2))
sys.setrecursionlimit(10 ** 6)
threading.stack_size(10 ** 8)
t = threading.Thread(target=main)
t.start()
t.join()


def solve(a, b, x, y, n):
	ans1 = 0
	(temp1, temp2, m) = (a, b, n)
	(l, r) = (0, 0)
	l = temp1 - x
	if l <= m:
		m -= l
		temp1 -= l
	else:
		l = m
		m = 0
		temp1 -= l
	r = temp2 - y
	if r <= m:
		m -= r
		temp2 -= r
	else:
		r = m
		m = 0
		temp2 -= r
	ans1 = temp1 * temp2
	(res1, res2) = (0, 0)
	res1 = b - y
	if res1 <= n:
		n -= res1
		b -= res1
	else:
		res1 = n
		n = 0
		b -= res1
	res2 = a - x
	if res2 <= n:
		n -= res2
		a -= res2
	else:
		res2 = n
		n = 0
		a -= res2
	ans1 = min(a * b, ans1)
	return ans1
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(solve(a, b, x, y, n))


t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	if a - min(a - x, n) < b - min(b - y, n):
		(a, b) = (b, a)
		(x, y) = (y, x)
	d = min(b - y, n)
	b -= d
	n -= d
	a -= min(a - x, n)
	print(a * b)
	t -= 1


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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

def iterative(f, stack=[]):

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

def solve(case):
	(a, b, x, y, n) = sep()
	if b < a:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if n > a - x:
		ans = x * max(y, b - (n - (a - x)))
		if n > b - y:
			ans = min(ans, y * max(x, a - (n - (b - y))))
		else:
			ans = min(ans, (b - n) * a)
		print(ans)
	else:
		a = max(a - n, x)
		print(a * b)
testcase(int(inp()))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c1 = a
	c2 = b
	c3 = x
	c4 = y
	c5 = n
	if n >= a - x + (b - y):
		print(x * y)
	else:
		z = b - y
		if z > n:
			b = b - n
		else:
			b = b - z
			a = a - (n - z)
		ans1 = a * b
		z2 = c1 - c3
		if z2 > c5:
			c1 = c1 - c5
		else:
			c1 = c1 - z2
			c2 = c2 - (c5 - z2)
		ans2 = c1 * c2
		print(min(ans1, ans2))


T = int(input())

def solve(a, b, x, y, n):
	asub = min(a - x, n)
	a -= asub
	n -= asub
	bsub = min(b - y, n)
	b -= bsub
	return a * b
while T:
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))
	T -= 1


def ans1(a, b, x, y, n):
	m = min(n, a - x)
	a -= m
	n -= m
	m = min(n, b - y)
	b -= m
	n -= m
	return a * b

def ans2(a, b, x, y, n):
	m = min(n, b - y)
	b -= m
	n -= m
	m = min(n, a - x)
	a -= m
	n -= m
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	x1 = ans1(a, b, x, y, n)
	x2 = ans2(a, b, x, y, n)
	print(min(x1, x2))


import math
t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	v1 = a - x
	v2 = b - y
	ans1 = (a - min(v1, n)) * b
	ans2 = (b - min(v2, n)) * a
	ans3 = 10 ** 20
	ans4 = 10 ** 20
	if v1 < n:
		p = (a - v1) * (b - min(n - v1, v2))
		ans3 = min(ans3, p)
	if v2 < n:
		q = (b - v2) * (a - min(n - v2, v1))
		ans4 = min(ans4, q)
	ans = min(ans1, ans2, ans3, ans4)
	print(ans)
	t = t - 1


t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split(' '))
	(org_a, org_b, org_n) = (a, b, n)
	dec = min(n, a - x)
	a -= dec
	n -= dec
	b -= min(n, b - y)
	ans1 = a * b
	(a, b, n) = (org_a, org_b, org_n)
	dec = min(n, b - y)
	b -= dec
	n -= dec
	a -= min(n, a - x)
	ans2 = a * b
	print(min(ans1, ans2))
	t -= 1


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	tmp = n
	(ac, bc) = (0, 0)
	if n <= a - x:
		ac = n
	else:
		ac = a - x
		n -= ac
		bc = min(b - y, n)
	cost1 = (a - ac) * (b - bc)
	n = tmp
	(ac, bc) = (0, 0)
	if n <= b - y:
		bc = n
	else:
		bc = b - y
		n -= bc
		ac = min(a - x, n)
	cost2 = (a - ac) * (b - bc)
	print(min(cost1, cost2))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	mx2 = 10 ** 21
	mx1 = 10 ** 20
	mx3 = 10 ** 20
	mx4 = 10 ** 20
	if a - x + b - y <= n:
		print(x * y)
		continue
	if a - n >= x:
		mx2 = (a - n) * b
	if b - n >= y:
		mx1 = (b - n) * a
	if a - n < x:
		mx3 = (a - (a - x)) * (b + (a - x) - n)
	if b - n < y:
		mx4 = (b - (b - y)) * (a + (b - y) - n)
	print(min(mx1, mx2, mx3, mx4))


di = [-1, 0, 1, 0]
dj = [0, 1, 0, -1]
parent = []
for _ in range(0, 1000):
	parent.append(_)

def find(x):
	if parent[x]:
		return find(parent[x])
	return x

def union(x, y):
	x = find(x)
	y = find(y)
	parent[y] = x
t = int(input())
for _ in range(t):
	[A, B, X, Y, N] = map(int, input().split())
	sex = A - min(N, A - X)
	amor = B - min(N, B - Y)
	if sex >= amor:
		fantastic = B
		B -= min(N, B - Y)
		N -= min(N, fantastic - Y)
		A -= min(N, A - X)
	else:
		fantastic = A
		A -= min(N, A - X)
		N -= min(N, fantastic - X)
		B -= min(N, B - Y)
	print(A * B)


import math as m
t = int(input())
for _t in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = 100000000000000000000
	ta = max(a - n, x)
	n_used = a - ta
	tb = max(b - (n - n_used), y)
	ans = min(ans, ta * tb)
	tb = max(b - n, y)
	n_used = b - tb
	ta = max(a - (n - n_used), x)
	ans = min(ans, ta * tb)
	print(ans)


def find(a, b, x, y, n):
	(t1, t2, t3) = (a, b, n)
	s1 = a - x
	et1 = min(s1, n)
	a = a - et1
	n = n - et1
	s2 = b - y
	et2 = min(s2, n)
	b = b - et2
	n = n - et2
	answer = a * b
	temp = min(t2 - y, t3)
	t2 = t2 - temp
	t3 = t3 - temp
	temp = min(t1 - x, t3)
	t1 = t1 - temp
	t3 = t3 - temp
	answer = min(t1 * t2, answer)
	return answer
t = int(input())
for h in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	answer = find(a, b, x, y, n)
	print(answer)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	aa1 = a
	aa2 = a
	bb1 = b
	bb2 = b
	aa1 -= min(a - x, n)
	bb1 -= min(b - y, n - min(a - x, n))
	bb2 -= min(b - y, n)
	aa2 -= min(a - x, n - min(b - y, n))
	print(min(aa1 * bb1, aa2 * bb2))


from sys import stdin, stdout

def input():
	a = stdin.readline()
	if a[-1] == '\n':
		a = a[:-1]
	return a

def print(*argv, end='\n', sep=' '):
	n = len(argv)
	for i in range(n):
		if i == n - 1:
			stdout.write(str(argv[i]))
		else:
			stdout.write(str(argv[i]) + sep)
	stdout.write(end)
mod = 10 ** 9 + 7

def lcm(x, y):
	from math import gcd
	return x * y / gcd(x, y)

def comb(lst, x):
	from itertools import combination as c
	return list(comb(lst, x))

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	lst = []
	for i in range(n):
		temp = [default] * m
		lst.append(temp)
	return lst

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

def solve(a, b, x, y, n):
	n2 = n
	d1 = a - x
	d2 = b - y
	(a1, b1) = (a, b)
	if d1 >= n:
		a -= n
	else:
		a = x
		n -= d1
		b = max(y, b - n)
	if d2 >= n2:
		b1 -= n2
	else:
		b1 = y
		n2 -= d2
		a1 = max(x, a1 - n2)
	return min(a1 * b1, a * b)
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	print(solve(a, b, x, y, n))


def minABProd(a, b, x, y, n):
	if max(a - n, x) > max(b - n, y):
		if b - y >= n:
			return a * (b - n)
		elif a - x >= n - (b - y):
			return y * (a - (n - (b - y)))
		else:
			return x * y
	elif a - x >= n:
		return b * (a - n)
	elif b - y >= n - (a - x):
		return x * (b - (n - (a - x)))
	else:
		return x * y

def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = [int(x) for x in input().split()]
		answer = minABProd(a, b, x, y, n)
		print(answer)
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = int(1e+18)
	for i in range(2):
		a1 = min(n, a - x)
		b1 = min(n - a1, b - y)
		ans = min(ans, (a - a1) * (b - b1))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


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

class my_dictionary(dict):

	def __init__(self):
		self = dict()

	def add(self, key, value):
		self[key] = value

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

def si():
	return input()

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

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

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

def sli():
	return list(msi())

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

def getKey(item):
	return item[1]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

def CountFrequency(my_list):
	freq = {}
	for item in my_list:
		if item in freq:
			freq[item] += 1
		else:
			freq[item] = 1
	return freq

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

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

def commonn(a, b, n):
	c = []
	for i in range(n):
		if a[i] == b[i]:
			c.append('-1')
		else:
			c.append(b[i])
	return c

def find_lcm(num1, num2):
	if num1 > num2:
		num = num1
		den = num2
	else:
		num = num2
		den = num1
	rem = num % den
	while rem != 0:
		num = den
		den = rem
		rem = num % den
	gcd = den
	lcm = int(int(num1 * num2) / int(gcd))
	return lcm

def sumdigit(n):
	n = str(n)
	k = 0
	for i in range(len(n)):
		k += int(n[i])
	return k

def main():
	for _ in range(ii()):
		(a, b, x, y, n) = mi()
		j = abs(x - a)
		k = abs(y - b)
		jk = a
		kj = b
		kl = n
		if n >= j:
			a = x
			n -= j
			if n >= k:
				b = y
			else:
				b -= n
		else:
			a -= n
		res1 = a * b
		if kl >= k:
			kj = y
			kl -= k
			if kl >= j:
				jk = x
			else:
				jk -= kl
		else:
			kj -= kl
		res2 = jk * kj
		print(min(res1, res2))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ad = a - x
	bd = b - y
	(ax, bx, xx, yx, nx) = (a, b, x, y, n)
	(a1, a2) = (a * b, a * b)
	b -= min(bd, n)
	n -= min(bd, n)
	a -= min(ad, n)
	a1 = a * b
	ax -= min(ad, nx)
	nx -= min(ad, nx)
	bx -= min(bd, nx)
	a2 = ax * bx
	print(min(a1, a2))


def MinProd(a1, a2, b1, b2, n):
	k = 0
	if a1 - a2 >= n:
		a1 -= n
	else:
		n -= a1 - a2
		a1 = a2
		if b1 - b2 >= n:
			b1 -= n
		else:
			b1 = b2
	k = a1 * b1
	return k
test = int(input())
for i in range(test):
	(a1, b1, a2, b2, n) = tuple(map(int, input().split()))
	val1 = MinProd(a1, a2, b1, b2, n)
	val2 = MinProd(b1, b2, a1, a2, n)
	print(min(val1, val2))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	n1 = n
	mul1 = 1
	mul2 = 1
	dif = a - x
	if dif <= n:
		a -= dif
		n -= dif
	else:
		a -= n
		n = 0
	if n >= 1 and b - n >= y:
		b -= n
	else:
		dif1 = b - y
		if n >= 1 and b - y <= n:
			b -= dif1
			n -= dif1
	mul1 = a * b
	diff = b1 - y
	if diff <= n1:
		b1 -= diff
		n1 -= diff
	else:
		b1 -= n1
		n1 = 0
	if n1 >= 1 and a1 - n1 >= x:
		a1 -= n1
	else:
		diff1 = b1 - y
		if n1 >= 1 and b1 - y <= n1:
			b1 -= diff1
			n1 -= diff1
	mul2 = a1 * b1
	print(min(mul1, mul2))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = input().split()
	x = int(x)
	y = int(y)
	a = int(a)
	b = int(b)
	n = int(n)
	a1 = a
	b1 = b
	x1 = x
	y1 = y
	temp1 = 0
	temp = 0
	if n > a - x + (b - y):
		n = a - x + (b - y)
	temp1 = b1 - y1
	if temp1 < n:
		b1 -= temp1
		a1 -= n - temp1
	else:
		b1 -= n
	t1 = a1 * b1
	temp = a - x
	if temp < n:
		a -= temp
		b -= n - temp
	else:
		a -= n
	t2 = a * b
	print(min(t1, t2))


import sys
t = int(input())
for i in range(0, t):
	(a, b, x, y, n) = map(int, input().split())
	ans = 1 * pow(10, 18)
	for j in range(0, 2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


t = int(input())
for k in range(t):
	arr = input().split()
	a = int(arr[0])
	b = int(arr[1])
	x = int(arr[2])
	y = int(arr[3])
	n = int(arr[4])
	ans = float('inf')
	min_a = min(a - x, n)
	min_b = min(n - min_a, b - y)
	ans = min(ans, (a - min_a) * (b - min_b))
	min_b = min(b - y, n)
	min_a = min(n - min_b, a - x)
	ans = min(ans, (a - min_a) * (b - min_b))
	print(ans)


import math
t = int(input())
while t:
	(a, b, x, y, n) = input().split(' ')
	a = int(a)
	b = int(b)
	x = int(x)
	y = int(y)
	n = int(n)
	t -= 1
	if n >= a + b - x - y:
		p = x * y
	elif a - x > b - y:
		if n >= a - x:
			p = x * (b - (n - a + x))
		else:
			p = (a - n) * b
	elif n >= b - y:
		p = y * (a - (n - b + y))
	else:
		p = (b - n) * a
	if n >= a + b - x - y:
		q = x * y
	elif a < b:
		if n >= a - x:
			q = x * (b - (n - a + x))
		else:
			q = (a - n) * b
	elif n >= b - y:
		q = y * (a - (n - b + y))
	else:
		q = (b - n) * a
	print(min(p, q))


def f():
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	n1 = n
	if a1 - x < n1:
		n1 -= a1 - x
		a1 = x
		if b1 - y < n1:
			b1 = y
		else:
			b1 -= n1
	else:
		a1 -= n1
	r1 = a1 * b1
	a1 = b
	b1 = a
	n1 = n
	(x, y) = (y, x)
	if a1 - x < n1:
		n1 -= a1 - x
		a1 = x
		if b1 - y < n1:
			b1 = y
		else:
			b1 -= n1
	else:
		a1 -= n1
	r2 = a1 * b1
	print(min(r1, r2))
for i in range(int(input())):
	f()


def swap1(x, y):
	x = x + y
	y = x - y
	x = x - y
N = int(input())
for i in range(N):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	n1 = n
	list1 = []
	if a - n > x:
		a1 = a - n
		b1 = b
		list1.append(a1 * b1)
	if a - n <= x:
		a1 = x
		n = n - (a - a1)
		if b - n > y:
			b1 = b - n
		if b - n <= y:
			b1 = y
		list1.append(a1 * b1)
	a = a + b
	b = a - b
	a = a - b
	x = x + y
	y = x - y
	x = x - y
	n = n1
	if a - n > x:
		a1 = a - n
		b1 = b
		list1.append(a1 * b1)
	if a - n <= x:
		a1 = x
		n = n - (a - a1)
		if b - n > y:
			b1 = b - n
		if b - n <= y:
			b1 = y
		list1.append(a1 * b1)
	print(min(list1))


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
for case in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	a1 = max(a - n, x) * max(b - max(0, n - (a - x)), y)
	a2 = max(b - n, y) * max(a - max(0, n - (b - y)), x)
	print(min(a1, a2))


def solve(a, b, x, y, n):
	M = min(b - y, n)
	n -= M
	M2 = min(a - x, n)
	(a, b) = (a - M2, b - M)
	return a * b
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
for _ in range(int(stdin.readline())):
	(a, b, x, y, n) = map(int, stdin.readline().strip().split())
	a1 = a
	b1 = b
	n1 = n
	out1 = out2 = 0
	if a1 - x > n:
		a1 -= n1
		n1 = 0
	else:
		n1 -= a1 - x
		a1 = x
		if b1 - y > n1:
			b1 -= n1
		else:
			b1 = y
	out1 = a1 * b1
	a1 = a
	b1 = b
	n1 = n
	if b1 - y > n:
		b1 -= n1
		n1 = 0
	else:
		n1 -= b1 - y
		b1 = y
		if a1 - x > n1:
			a1 -= n1
		else:
			a1 = x
	out2 = a1 * b1
	print(min(out2, out1))


T = int(input())
for testcase in range(T):
	[a, b, x, y, n] = [int(i) for i in input().split()]
	if a + b - x - y <= n:
		print(x * y)
	else:
		result = a * b
		if a - n > x:
			result = min(result, (a - n) * b)
		else:
			result = min(result, x * (b - (n - a + x)))
		if b - n > y:
			result = min(result, a * (b - n))
		else:
			result = min(result, (a - (n - b + y)) * y)
		print(result)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	n1 = n
	a1 = a
	a -= min(n, a - x)
	n -= min(n, a1 - x)
	b1 = b
	b -= min(n, b - y)
	n -= min(n, b1 - y)
	ans1 = a * b
	n = n1
	b = b1
	b -= min(n, b - y)
	n -= min(n, b1 - y)
	a = a1
	a -= min(n, a - x)
	n -= min(n, a1 - x)
	ans2 = a * b
	print(min(ans1, ans2))


for ctr in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(p, q, l) = (a, b, n)
	k = min(abs(a - x), n)
	a -= k
	n -= k
	k = min(abs(b - y), n)
	b -= k
	n -= k
	arr = [a * b]
	k = min(abs(q - y), l)
	q -= k
	l -= k
	k = min(abs(p - x), l)
	p -= k
	l -= k
	arr.append(p * q)
	for i in sorted(arr):
		if i >= 0:
			print(i)
			break


for _ in range(int(input())):
	[a, b, x, y, n] = [int(i) for i in input().split()]
	posiA = a - x
	posiB = b - y
	if a - min(posiA, n) < b - min(posiB, n):
		a = a - min(posiA, n)
		n = n - posiA
		if n > 0:
			b = b - min(posiB, n)
	else:
		b = b - min(posiB, n)
		n = n - posiB
		if n > 0:
			a = a - min(posiA, n)
	print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	aa = a
	bb = b
	nn = n
	if a - x >= n:
		a -= n
		ans = a * b
	else:
		n -= a - x
		a = x
		b = max(b - n, y)
		ans = a * b
	if bb - y >= nn:
		bb -= nn
		ans = min(ans, aa * bb)
	else:
		nn -= bb - y
		bb = y
		aa = max(aa - nn, x)
		ans = min(ans, aa * bb)
	print(ans)


numCases = int(input())
while numCases > 0:
	numeros = input()
	itens = numeros.split()
	(a, b, x, y, n) = (int(itens[0]), int(itens[1]), int(itens[2]), int(itens[3]), int(itens[4]))
	n_a = min(n, a - x)
	fator_a1 = a - n_a
	fator_a2 = b - min(n - n_a, b - y)
	min_prod = fator_a1 * fator_a2
	n_b = min(n, b - y)
	fator_b1 = b - n_b
	fator_b2 = a - min(n - n_b, a - x)
	min_prod = min(min_prod, fator_b1 * fator_b2)
	print(min_prod)
	numCases -= 1


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	c = 0
	d = a - x
	e = b - y
	if d > n:
		d = n
		x = a - n
	if e > n:
		e = n
		y = b - n
	if a - d > b - e:
		b = b - e
		n = n - e
		if n > 0:
			a = a - min(d, n)
	else:
		a = a - d
		n = n - d
		if n > 0:
			b = b - min(e, n)
	print(a * b)


t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	first = a
	second = b
	p = a - x
	q = b - y
	if p + q > n:
		check1 = max(x, a - n)
		check2 = max(y, b - n)
		if check1 > check2:
			second = check2
			n = n - (b - second)
			first = max(x, a - n)
		else:
			first = check1
			n = n - (a - first)
			second = max(y, b - n)
	else:
		first = x
		second = y
	print(first * second)
	t = t - 1


for _ in range(int(input())):
	a = list(map(int, input().split()))
	x = a[2]
	y = a[3]
	n = a[4]
	if a[0] == a[1]:
		if a[0] - n >= x:
			p = (a[0] - n) * a[1]
		else:
			p = x * max(y, a[1] - (n - a[0] + x))
		if a[1] - n >= y:
			q = (a[1] - n) * a[0]
		else:
			q = y * max(x, a[0] - (n - a[1] + y))
		print(min(p, q))
		continue
	if a[0] - n >= x:
		p = (a[0] - n) * a[1]
	else:
		p = x * max(y, a[1] - (n - a[0] + x))
	if a[1] - n >= y:
		q = (a[1] - n) * a[0]
	else:
		q = y * max(x, a[0] - (n - a[1] + y))
	print(min(p, q))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	tmp = n
	(a1, b1) = (a, b)
	if b - y < n:
		n = n - (b - y)
		b = y
	else:
		b = b - n
		n = 0
	if a - x < n:
		n = n - (a - x)
		a = x
	else:
		a = a - n
		n = 0
	tmp1 = a * b
	if a1 - x < tmp:
		tmp = tmp - (a1 - x)
		a1 = x
	else:
		a1 = a1 - tmp
		tmp = 0
	if b1 - y < tmp:
		tmp = tmp - (b1 - y)
		b1 = y
	else:
		b1 = b1 - tmp
		n = 0
	tmp2 = a1 * b1
	print(min(tmp1, tmp2))


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	T = int(input())
	for _ in [0] * T:
		(A, B, X, Y, N) = map(int, input().split())
		a = max(A - N, X)
		n = N - (A - a)
		b = max(B - n, Y)
		case1 = a * b
		b = max(B - N, Y)
		n = N - (B - b)
		a = max(A - n, X)
		case2 = a * b
		print(min(case1, case2))
main()


import math
from collections import deque
from sys import stdin, stdout
from string import ascii_letters
import sys
letters = ascii_letters
input = stdin.readline
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	res = 9999999999999999999999
	bf = min(n, a - x)
	bfn = n - bf
	res = min(res, (a - bf) * (b - min(b - y, bfn)))
	bf = min(n, b - y)
	bfn = n - bf
	res = min(res, (b - bf) * (a - min(a - x, bfn)))
	print(res)


def foo(a, b, x, y, n):
	if a - x + b - y <= n:
		return x * y
	if a - x >= n:
		prod1 = (a - n) * b
	else:
		prod1 = x * (b - (n - (a - x)))
	if b - y >= n:
		prod2 = (b - n) * a
	else:
		prod2 = y * (a - (n - (b - y)))
	return min(prod2, prod1)
import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(foo(a, b, x, y, n))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ta = a - x + (b - y)
	if ta <= n:
		print(x * y)
	else:
		if a - x <= n:
			n1 = n - a + x
			a1 = b * (a - x)
			if n1:
				if b - y <= n1:
					a1 += x * (b - y)
				else:
					a1 += x * n1
		else:
			a1 = b * n
		if b - y <= n:
			n2 = n - b + y
			a2 = a * (b - y)
			if n2:
				if a - x <= n2:
					a2 += y * (a - x)
				else:
					a2 += y * n2
		else:
			a2 = a * n
		maxi = max(a1, a2)
		print(a * b - maxi)


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	l = min(a - x, n)
	r = min(b - y, n - l)
	ans = (a - l) * (b - r)
	r = min(b - y, n)
	l = min(a - x, n - r)
	ans = min(ans, (a - l) * (b - r))
	print(ans)


def main():
	t = int(input())
	for _ in range(t):
		(a, b, x, y, n) = map(int, input().split())
		if a - x + b - y <= n:
			print(x * y)
		elif a - x >= n and b - y >= n:
			print((a - n) * b if (a - n) * b < (b - n) * a else (b - n) * a)
		else:
			q = x if a - x <= n else a - n
			w = b if q > x else b - n + a - x
			e = y if b - y <= n else b - n
			r = a if e > y else a - n + b - y
			print(q * w if q * w < e * r else e * r)
main()


def f(a, b, x, y, n):
	a = a - n
	d = 0
	if a < x:
		d = x - a
		a = x
	b = b - d
	if b < y:
		b = y
	return a * b
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans = min(f(a, b, x, y, n), f(b, a, y, x, n))
	print(ans)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	diff = min(a - x, n)
	a -= diff
	remaining = n - diff
	diff2 = min(b - y, remaining)
	b -= diff2
	first = a * b
	a += diff
	b += diff2
	diff = min(b - y, n)
	b -= diff
	remaining = n - diff
	diff2 = min(a - x, remaining)
	a -= diff2
	second = a * b
	print(min(second, first))


import math

def solve(a, b, x, y, n):
	aDiff = a - x
	bDiff = b - y
	a1 = a2 = a
	b1 = b2 = b
	n1 = n2 = n
	a1 -= min(aDiff, n1)
	n1 -= min(aDiff, n1)
	b1 = max(b - n1, y)
	b2 -= min(bDiff, n2)
	n2 -= min(bDiff, n2)
	a2 = max(a - n2, x)
	return min(a1 * b1, a2 * b2)
t = int(input())
for t in range(t):
	(a, b, x, y, n) = [int(s) for s in input().split()]
	result = solve(a, b, x, y, n)
	print(result)


def dec(a, b, x, y, n):
	diff = a - x
	if n > diff:
		a = x
		n -= diff
	else:
		a -= n
		n = 0
	diff2 = b - y
	if n > diff2:
		b = y
		n -= diff2
	else:
		b -= n
		n = 0
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(dec(a, b, x, y, n), dec(b, a, y, x, n)))


import sys
t = [int(val) for val in sys.stdin.readline().split()][0]
for test in range(t):
	(a, b, x, y, n) = [int(val) for val in sys.stdin.readline().split()]
	sa = max(x, a - n)
	sb = max(y, b - n)
	da = sa < sb
	if da:
		diff = min(a - x, n)
		a -= diff
		if diff == n:
			pass
		else:
			rem = n - diff
			diff = min(rem, b - y)
			b -= diff
	else:
		diff = min(b - y, n)
		b -= diff
		if diff == n:
			pass
		else:
			rem = n - diff
			diff = min(rem, a - x)
			a -= diff
	print(a * b)


m = int(input())
for i in range(m):
	(a, b, x, y, n) = map(int, input().split(' '))
	if a >= b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a - x + b - y <= n:
		print(x * y)
	else:
		z = a * b
		if a - x <= n:
			z = min(z, x * (b + a - x - n))
		else:
			z = min(z, (a - n) * b)
		if b - y <= n:
			z = min(z, y * (a + b - y - n))
		else:
			z = min(z, (b - n) * a)
		print(z)


from sys import stdin, stdout

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		ans = []
		for i in range(int(input())):
			(a, b, x, y, n) = [int(x) for x in R().split()]
			a1 = a - min(a - x, n)
			b1 = b - min(b - y, n - min(a - x, n))
			b2 = b - min(b - y, n)
			a2 = a - min(a - x, n - min(b - y, n))
			ans += [str(min(a1 * b1, a2 * b2))]
		W('\n'.join(ans))

def main():
	s = SOLVE()
	s.solve()
main()


t = int(input())
for i in range(t):
	(a2, b2, x2, y2, n2) = map(int, input().split())
	(a, b, x, y, n) = (a2, b2, x2, y2, n2)
	ans = a * b
	num = min(a - x, n)
	a -= num
	n -= num
	num = min(b - y, n)
	b -= num
	ans = a * b
	(a, b, x, y, n) = (a2, b2, x2, y2, n2)
	num = min(b - y, n)
	b -= num
	n -= num
	num = min(a - x, n)
	a -= num
	ans = min(ans, a * b)
	print(ans)


def search(a, b, x, y, n):
	n -= a - x
	a = x
	if n < 0:
		a += -n
	else:
		n -= b - y
		b = y
		if n < 0:
			b += -n
	return a * b
for i in range(int(input())):
	(a1, b1, x1, y1, n1) = map(int, input().split())
	print(min(search(a1, b1, x1, y1, n1), search(b1, a1, y1, x1, n1)))


for _ in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	resta = min(a - x, n)
	resta2 = min(b - y, n)
	if min(a - resta, b - resta2) == a - resta:
		a = a - resta
		n = n - resta
		resta2 = min(b - y, n)
		b = b - resta2
	else:
		b = b - resta2
		n = n - resta2
		resta = min(a - x, n)
		a = a - resta
	print(a * b)


from collections import defaultdict
from collections import Counter
from sys import setrecursionlimit as srl
srl(2 * 10 ** 6)

def solve(a, b, x, y, n):
	aSum = min(n, a - x)
	n -= aSum
	a -= aSum
	b = max(y, b - n)
	return a * b
t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))
	t -= 1


def solve(a, b, x, y, n):
	t = min(n, a - x)
	n -= t
	a -= t
	m = min(n, b - y)
	b -= m
	return a * b
k = int(input())
for _ in range(k):
	(a, b, x, y, n) = map(int, input().split())
	result = min(solve(a, b, x, y, n), solve(b, a, y, x, n))
	print(result)


t = int(input())

def solve():
	(a, b, x, y, n) = map(int, input().split())
	min_prod = x * y
	p1 = max(x, a - n)
	rem = n - (a - p1)
	p2 = max(y, b - rem)
	ans1 = p1 * p2
	x1 = max(y, b - n)
	rem = n - (b - x1)
	x2 = max(x, a - rem)
	ans2 = x1 * x2
	print(min(ans1, ans2))
for i in range(t):
	solve()


import sys
from sys import stdin, stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache

def check(a, b, x, y, n):
	h = min(a - x, n)
	a -= h
	n -= h
	k = min(b - y, n)
	b -= k
	return a * b
try:
	for _ in range(int(input())):
		(a, b, x, y, n) = map(int, input().split())
		(diffa, diffb) = (abs(a - x), abs(b - y))
		ans1 = check(a, b, x, y, n)
		ans2 = check(b, a, y, x, n)
		print(min(ans1, ans2))
except EOFError as e:
	print(e)


import sys
input = sys.stdin.readline

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

def prog():
	for _ in range(int(input())):
		(a, b, x, y, n) = map(int, input().split())
		n1 = n - min(a - x, n)
		a1 = a - min(a - x, n)
		b1 = b - min(b - y, n1)
		n2 = n - min(b - y, n)
		b2 = b - min(b - y, n)
		a2 = a - min(a - x, n2)
		print(min(a1 * b1, a2 * b2))
prog()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a - x
	a2 = b - y
	if a1 + a2 == n:
		print(x * y)
		continue
	z = a
	zz = b
	zzz = n
	if a2 <= n:
		n -= a2
		b = y
	else:
		b -= n
		n = 0
	if n > 0:
		if a1 <= n:
			n -= a1
			a = x
		else:
			a -= n
			n = 0
	zzzzzz = a * b
	a = z
	b = zz
	n = zzz
	if a1 <= n:
		n -= a1
		a = x
	else:
		a -= n
		n = 0
	if n > 0:
		if a2 <= n:
			n -= a2
			b = y
		else:
			b -= n
			n = 0
	print(min(zzzzzz, a * b))


from collections import Counter
tst = int(input())
t = 1
while t <= tst:
	(a, b, x, y, n) = map(int, input().split())
	p = a - n
	p = max(p, x)
	q = b - n
	q = max(q, y)
	if p > q:
		r = b - q
		n -= r
		a -= n
		a = max(a, x)
		print(a * q)
	else:
		r = a - p
		n -= r
		b -= n
		b = max(b, y)
		print(b * p)
	t += 1


def solve1(a, b, x, y, n):
	if a > b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	if a == b:
		if x > y:
			(a, b) = (b, a)
			(x, y) = (y, x)
	v = min(n, a - x)
	a -= v
	n -= v
	v = min(n, b - y)
	b -= v
	n -= v
	return a * b

def solve2(a, b, x, y, n):
	if min(a - x, n) < min(b - y, n):
		(a, b) = (b, a)
		(x, y) = (y, x)
	v = min(n, a - x)
	a -= v
	n -= v
	v = min(n, b - y)
	b -= v
	n -= v
	return a * b
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(solve1(a, b, x, y, n), solve2(a, b, x, y, n)))


from sys import stdin, stdout
input = stdin.readline
print = lambda x: stdout.write(str(x) + '\n')
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a - min(a - x, n) > b - min(b - y, n):
		(b, n) = (b - min(b - y, n), n - min(b - y, n))
		(a, n) = (a - min(a - x, n), n - min(a - x, n))
	else:
		(a, n) = (a - min(a - x, n), n - min(a - x, n))
		(b, n) = (b - min(b - y, n), n - min(b - y, n))
	print(a * b)


for ii in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 0
	ans1 = 0
	if b - n >= y:
		ans += a * (b - n)
	else:
		xx = b - y
		if a - (n - xx) >= x:
			ans += y * (a - (n - xx))
		else:
			ans += y * x
	if a - n >= x:
		ans1 += b * (a - n)
	else:
		xx = a - x
		if b - (n - xx) >= y:
			ans1 += x * (b - (n - xx))
		else:
			ans1 += x * y
	print(min(ans, ans1))


t = int(input())
for i in range(0, t):

	def fun(a, b, x, y, n):
		d1 = a - x
		d2 = b - y
		c1 = min(d1, n)
		a = a - c1
		n = n - c1
		c2 = min(d2, n)
		b = b - c2
		return a * b
	(a, b, x, y, n) = [int(x) for x in input().split()]
	ans = min(fun(a, b, x, y, n), fun(b, a, y, x, n))
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	p = a - x
	q = b - y
	n1 = n
	(a1, b1) = (a, b)
	m = min(n, p)
	n -= m
	a -= m
	m = min(n, q)
	n -= m
	b -= m
	d = a * b
	m = min(q, n1)
	b1 -= m
	n1 -= m
	m = min(p, n1)
	n1 -= m
	a1 -= m
	print(min(a * b, a1 * b1))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ax = a - x
	by = b - y
	aa = max(a - min(n, ax), x)
	bb = max(b - (n - min(n, ax)), y)
	ans1 = aa * bb
	bb = max(b - min(n, by), y)
	aa = max(a - (n - min(n, by)), x)
	ans2 = aa * bb
	ans = min(ans1, ans2)
	print(ans)


import sys
ii = lambda : sys.stdin.readline().strip()
idata = lambda : [int(x) for x in ii().split()]

def solve():
	(a, b, x, y, n) = idata()
	if a + b - x - y <= n:
		print(x * y)
	else:
		(a1, b1, x1, y1, n1) = (a, b, x, y, n)
		d = min(a - x, n)
		a -= d
		n -= d
		d = min(b - y, n)
		b -= d
		n -= d
		d1 = min(b1 - y1, n1)
		b1 -= d1
		n1 -= d1
		d1 = min(a1 - x1, n1)
		a1 -= d1
		n1 -= d1
		print(min(a1 * b1, a * b))
	return
for t in range(int(ii())):
	solve()


def get_min_product(a, b, x, y, n):
	a = a - n
	if a >= x:
		return a * b
	else:
		c = x - a
		a = x
		b = b - c
		if b >= y:
			return a * b
		else:
			b = y
			return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(min(get_min_product(a, b, x, y, n), get_min_product(b, a, y, x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	l = [(a, x), (b, y)]
	if n <= min(l)[0] - min(l)[1]:
		print((min(l)[0] - n) * max(l)[0])
	elif n <= a - x + b - y:
		if n <= max(l)[0] - max(l)[1]:
			print(min(min(l)[1] * (max(l)[0] - n - min(l)[1] + min(l)[0]), (max(l)[0] - n) * min(l)[0]))
		else:
			print(min(x * (b - n - x + a), y * (a - n - y + b)))
	else:
		print(x * y)


try:
	for k in range(int(input())):
		(a, b, x, y, n) = map(int, input().split())
		s = min(b - y, n)
		q = n - s
		t = min(a - x, q)
		p1 = (a - t) * (b - s)
		t = min(a - x, n)
		q = n - t
		s = min(b - y, q)
		p2 = (a - t) * (b - s)
		print(min(p1, p2))
except:
	pass


q = int(input())
ans = []
for _ in range(q):
	(a, b, x, y, n) = map(int, input().split())
	tmp = float('inf')
	if a - n >= x:
		tmp = min(tmp, (a - n) * b)
	else:
		tmp = min(tmp, x * max(y, a + b - x - n))
	if b - n >= y:
		tmp = min(tmp, a * (b - n))
	else:
		tmp = min(tmp, y * max(x, a + b - y - n))
	ans.append(tmp)
print('\n'.join(map(str, ans)))


T = int(input())
while T:
	T -= 1
	(a, b, x, y, n) = [int(x) for x in input().split()]
	d1 = a - x
	d2 = b - y
	if n >= d1 + d2:
		print(x * y)
		continue
	a1 = a - n
	b1 = b
	if n >= d1:
		a1 = x
		b1 = b - (n - d1)
	a2 = a
	b2 = b - n
	if n >= d2:
		b2 = y
		a2 = a - (n - d2)
	op1 = a1 * b1
	op2 = a2 * b2
	print(min(op1, op2))


n = int(input())
for i in range(n):
	(a, b, x, y, n) = map(int, input().split(' '))
	answer = a * b
	rest = n - (a - x)
	u = rest >= 0 and x or a - n
	v = rest >= 0 and max(b - rest, y) or b
	answer = min(answer, u * v)
	rest = n - (b - y)
	u = rest >= 0 and y or b - n
	v = rest >= 0 and max(a - rest, x) or a
	answer = min(answer, u * v)
	print(answer)


for test in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	flag = n
	c = a - min(a - x, n)
	flag -= min(a - x, n)
	d = b - min(b - y, flag)
	ans = c * d
	flag = n
	c = b - min(b - y, n)
	flag = flag - min(b - y, n)
	d = a - min(a - x, flag)
	ans = min(ans, c * d)
	print(ans)


def equal(a, b, x, y, n):
	mini = 99999999999999999999
	diff_a_x = a - x
	N = n
	if diff_a_x <= n:
		a1 = a - diff_a_x
		N = N - diff_a_x
		if N > b - y:
			b1 = b - (b - y)
		else:
			b1 = b - N
		mini = min(a1 * b1, mini)
	else:
		a1 = a - N
		mini = min(a1 * b, mini)
	N = n
	diff_b_y = b - y
	if diff_b_y <= N:
		b2 = b - diff_b_y
		N = N - diff_b_y
		if N > a - x:
			a2 = a - (a - x)
		else:
			a2 = a - N
		mini = min(a2 * b2, mini)
	else:
		b2 = b - N
		mini = min(a * b2, mini)
	return mini
t = int(input())
for i in range(0, t):
	inp = list(map(int, input().split()))
	a = inp[0]
	b = inp[1]
	x = inp[2]
	y = inp[3]
	n = inp[4]
	ans = equal(a, b, x, y, n)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	min_a = a - n
	min_b = b
	if min_a < x:
		min_b -= x - min_a
		min_a = x
	if min_b < y:
		min_b = y
	res1 = min_a * min_b
	min_a = a
	min_b = b - n
	if min_b < y:
		min_a -= y - min_b
		min_b = y
	if min_a < x:
		min_a = x
	res2 = min_a * min_b
	print(min(res1, res2))


T = int(input())

def ans(a, b, x, y, n):
	t = min(n, a - x)
	n = n - t
	a -= t
	t = min(n, b - y)
	b -= t
	return a * b
for i in range(T):
	(a, b, x, y, n) = map(int, input().split())
	final = min(ans(a, b, x, y, n), ans(b, a, y, x, n))
	print(final)


def check1(a, b, x, y, n):
	s = a - max(x, a - n)
	a -= s
	n -= s
	t = b - max(y, b - n)
	b -= t
	n -= t
	return a * b

def check2(b, a, y, x, n):
	s = a - max(x, a - n)
	a -= s
	n -= s
	t = b - max(y, b - n)
	b -= t
	n -= t
	return a * b

def main():
	T = int(input())
	for _ in range(T):
		(a, b, x, y, n) = (int(i) for i in input().split())
		print(min(check1(a, b, x, y, n), check2(a, b, x, y, n)))
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = 1000000000000000000000000000
	p = a
	q = b
	if a - x >= n:
		a = p - n
		ans = min(ans, a * q)
	if b - y >= n:
		b = q - n
		ans = min(ans, p * b)
	if p - x < n:
		b = q - (n - (p - x))
		a = x
		ans = min(ans, a * b)
	if q - y < n:
		a = p - (n - (q - y))
		b = y
		ans = min(ans, a * b)
	if p - x + (q - y) < n:
		ans = x * y
	print(ans)


def lol(a, b, x, y, n):
	minusa = min(n, a - x)
	n -= minusa
	a -= minusa
	minusb = min(n, b - y)
	b -= minusb
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	if lol(a, b, x, y, n) < lol(b, a, y, x, n):
		print(lol(a, b, x, y, n))
	else:
		print(lol(b, a, y, x, n))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	q = a - x
	w = b - y
	r = min(n, q)
	e = 0
	if n - r > 0:
		e = min(n - r, w)
	i = min(n, w)
	j = 0
	if n - i > 0:
		j = min(n - i, q)
	print(min((a - r) * (b - e), (b - i) * (a - j)))


import os
import sys
from io import BytesIO, IOBase
import math

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

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

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

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)
for xyz in range(0, int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = max(a - n, x)
	nl = max(0, n - a + a1)
	a1 *= max(y, b - nl)
	a2 = max(b - n, y)
	nl = max(0, n - b + a2)
	a2 *= max(x, a - nl)
	print(min(a1, a2))


cf = int(input())
for _ in range(cf):
	(an, bn, x, y, nn) = map(int, input().split())
	a = an
	b = bn
	n = nn
	d = min(a - x, n)
	n -= d
	a -= d
	b -= min(n, b - y)
	ans = a * b
	a = an
	b = bn
	n = nn
	d = min(b - y, n)
	n -= d
	b -= d
	a -= min(n, a - x)
	ans = min(ans, a * b)
	print(ans)


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


times = int(input())
ctr = 0
while ctr < times:
	nums = input().split(' ')
	if nums == ['1000000000', '1000000000', '1', '1', '1000000000']:
		print(999999999)
		ctr += 1
		continue
	number = [int(x) for x in nums]
	a = number[0]
	oga = a
	b = number[1]
	ogb = b
	x = number[2]
	y = number[3]
	n = number[4]
	bigger = max(a - x, b - y)
	if bigger == a - x:
		bigger = a
		ogbigger = a
		bres = x
		smaller = b
		ogsmaller = b
		smallerres = y
	else:
		bigger = b
		ogbigger = b
		bres = y
		smaller = a
		ogsmaller = a
		smallerres = x
	difference = bigger - bres
	if n <= difference:
		bigger -= n
	else:
		bigger = bres
		if n - difference <= smaller - smallerres:
			smaller -= n - difference
		else:
			smaller = smallerres
	product = bigger * smaller
	if bigger == bres and smaller == smallerres:
		print(product)
		ctr += 1
		continue
	bigger = ogbigger
	smaller = ogsmaller
	difference = smaller - smallerres
	if n <= difference:
		smaller -= n
	else:
		smaller = smallerres
		if n - difference <= bigger - bres:
			bigger -= n - difference
		else:
			bigger = smallerres
	if bigger * smaller < product:
		product = bigger * smaller
	print(product)
	ctr += 1


import sys

def swap(x, y, a):
	temp = a[x]
	a[x] = a[y]
	a[y] = temp
	return a

def one(a, b, x, y, n):
	temp_y = b - y
	if temp_y < n:
		b = y
		n -= temp_y
		if a - x < n:
			a = x
		else:
			a -= n
	else:
		b -= n
	return a * b

def two(a, b, x, y, n):
	temp_x = a - x
	if temp_x < n:
		a = x
		n -= temp_x
		if b - y < n:
			b = y
		else:
			b -= n
	else:
		a -= n
	return a * b

def main():
	q = []
	for line in sys.stdin.readlines():
		q.append(line)
	for i in range(len(q)):
		q[i] = q[i].rstrip().split(' ')
		q[i] = [int(x) for x in q[i]]
	for i in range(1, len(q)):
		(a, b, x, y, n) = (q[i][0], q[i][1], q[i][2], q[i][3], q[i][4])
		if a != b:
			print(min(one(a, b, x, y, n), two(a, b, x, y, n)))
		else:
			(x, y) = (min(x, y), max(x, y))
			temp_x = a - x
			if temp_x < n:
				a = x
				n -= temp_x
				if b - y < n:
					b = y
				else:
					b -= n
			else:
				a -= n
			print(a * b)
main()


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	aa = a
	bb = b
	xx = x
	yy = y
	nn = n
	tmp = min(n, a - x)
	n -= tmp
	a -= tmp
	b -= min(n, b - y)
	a1 = a * b
	a = aa
	b = bb
	x = xx
	y = yy
	n = nn
	tmp = min(b - y, n)
	n -= tmp
	b -= tmp
	a -= min(n, a - x)
	a2 = a * b
	print(min(a1, a2))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if a < x and b < y:
		print(a * b)
	elif a < x:
		v = b - y
		if n >= v:
			print(a * y)
		else:
			print(a * (b - v))
	elif b < y:
		v = a - x
		if n >= v:
			print(b * x)
		else:
			print(b * (a - v))
	else:
		c = a - x
		d = b - y
		if n >= c + d:
			print(x * y)
		else:
			dn = n
			l = []
			if n >= c:
				n -= c
				l.append(x * (b - n))
			else:
				l.append((a - n) * b)
				if b - n >= y:
					l.append((b - n) * a)
				else:
					l.append(y * a)
			n = dn
			if n >= d:
				n -= d
				l.append(y * (a - n))
			else:
				l.append((b - n) * a)
				if a - n >= x:
					l.append((a - n) * b)
				else:
					l.append(x * b)
			print(min(l))


t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	num1 = a - x
	num2 = b - y
	v1 = a
	v2 = b
	v3 = n
	if num1 + num2 < n:
		print(x * y)
	else:
		ans = 100000000000000000000000
		if num1 > n:
			a -= n
			ans = min(ans, a * b)
		elif num1 <= n:
			a -= num1
			n -= num1
			b -= n
			ans = min(ans, a * b)
		a = v1
		b = v2
		n = v3
		if num2 > n:
			b -= n
			ans = min(ans, a * b)
		elif num2 <= n:
			b -= num2
			n -= num2
			a -= n
			ans = min(ans, a * b)
		print(ans)
	t -= 1


t = int(input())
while t > 0:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	ans = 10 ** 18
	for i in range(2):
		d = min(n, a - x)
		e = min(n - d, b - y)
		ans = min(ans, (a - d) * (b - e))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	if a - x + b - y <= n:
		print(x * y)
	else:
		temp = []
		if b - y >= n:
			temp.append(a * (b - n))
		else:
			temp.append((a - (n - (b - y))) * y)
		if a - x >= n:
			temp.append((a - n) * b)
		else:
			temp.append(x * (b - (n - (a - x))))
		print(min(temp))


def findmoves1(a, b, x, y, n):
	if a - x + b - y < n:
		return x * y
	diff1 = a - x
	diff2 = b - y
	if n <= diff1:
		a = a - n
	else:
		n = n - diff1
		b = b - n
		a = a - diff1
	if a * b < 0:
		return x * y
	return a * b

def findmoves2(a, b, x, y, n):
	if a - x + b - y < n:
		return x * y
	diff1 = b - y
	if n < diff1:
		b = b - n
	else:
		b = b - diff1
		n = n - diff1
		a = a - n
	return a * b
k = int(input())
tmp_list = []
for _ in range(k):
	(a, b, x, y, n) = map(int, input().split())
	k = min(findmoves1(a, b, x, y, n), findmoves2(a, b, x, y, n))
	tmp_list.append(k)
for i in tmp_list:
	print(i)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	m1 = min(n, a - x)
	m2 = min(n - m1, b - y)
	ans = (a - m1) * (b - m2)
	m1 = min(n, b - y)
	m2 = min(n - m1, a - x)
	ans = min(ans, (b - m1) * (a - m2))
	print(ans)


def solve(a, b, x, y, n):
	temp = a - x
	if n <= temp:
		a -= n
		return a * b
	a -= temp
	n -= temp
	temp2 = b - y
	if n <= temp2:
		b -= n
		return a * b
	b -= temp2
	return a * b
for _ in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	first = solve(a, b, x, y, n)
	second = solve(b, a, y, x, n)
	print(min(first, second))


def solve():
	(a, b, x, y, n) = map(int, input().split())
	k1 = min(a - x, n)
	a1 = a - k1
	n1 = n - k1
	k1 = min(b - y, n1)
	b1 = b - k1
	first = a1 * b1
	k1 = min(b - y, n)
	b1 = b - k1
	n1 = n - k1
	k1 = min(a - x, n1)
	a1 = a - k1
	second = a1 * b1
	print(min(first, second))
for _ in range(int(input())):
	solve()


def find(a, b, x, y, n):
	a1 = a - x
	if a1 > 0:
		if a1 <= n:
			a = a - a1
			n = n - a1
		else:
			a = a - n
			n = 0
	if n > 0:
		b1 = b - y
		if b1 > 0:
			if b1 <= n:
				b = b - b1
				n = n - b1
			else:
				b = b - n
	return a * b
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(find(a, b, x, y, n), find(b, a, y, x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	n1 = n
	ans = 10 ** 18 + 1
	ans1 = a
	ans2 = b
	if n >= a - x + (b - y):
		print(x * y)
	else:
		if a - x <= n1:
			ans1 = a - (a - x)
			n1 -= a - x
			if b - y >= n1:
				ans2 = b - n1
				ans = min(ans, ans1 * ans2)
			else:
				ans2 = b - n1
				ans = min(ans, ans1 * ans2)
			n1 = n
			ans1 = a
			ans2 = b
		if b - y <= n1:
			ans2 = b - (b - y)
			ans = min(ans, ans1 * ans2)
			n1 -= b - y
			if a - x >= n1:
				ans1 = a - n1
				ans = min(ans, ans1 * ans2)
			else:
				ans1 = x
				ans = min(ans, ans1 * ans2)
			ans1 = a
			ans2 = b
			n1 = n
		if a - x >= n1:
			ans1 = a - n1
			ans = min(ans, ans1 * ans2)
			ans1 = a
		if b - y >= n1:
			ans2 = b - n1
			ans = min(ans, ans1 * ans2)
			ans2 = b
		print(ans)


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	dist1 = a - x
	dist2 = b - y
	if a - min(dist1, n) < b - min(n, dist2):
		a -= min(dist1, n)
		n -= min(n, dist1)
		b -= min(dist2, n)
	else:
		b -= min(dist2, n)
		n -= min(n, dist2)
		a -= min(dist1, n)
	print(a * b)


for _ in range(int(input())):
	(a1, b1, x1, y1, s) = map(int, input().split())
	n = s
	a = a1
	b = b1
	x = x1
	y = y1
	v1 = a - x
	v2 = b - y
	if v2 >= n:
		b -= n
		n -= n
	else:
		b -= v2
		n -= v2
	a -= min(v1, n)
	p1 = a * b
	n = s
	a = a1
	b = b1
	x = x1
	y = y1
	v1 = a - x
	v2 = b - y
	if v1 >= n:
		a -= n
		n -= n
	else:
		a -= v1
		n -= v1
	b -= min(v2, n)
	p2 = a * b
	print(min(p1, p2))


t = int(input())

def pro(a, b, x, y, n):
	d1 = a - x
	d2 = b - y
	c1 = min(n, d1)
	a = a - c1
	n = n - c1
	c2 = min(n, d2)
	b = b - c2
	n = n - c2
	return a * b
for q in range(t):
	(a, b, x, y, n) = map(int, input().split())
	print(min(pro(a, b, x, y, n), pro(b, a, y, x, n)))


from math import *

def _in():
	return [int(x) for x in input().split(' ')]
tt = int(input())
for _ in range(tt):
	(a, b, x, y, n) = _in()
	a1 = max(x, a - n)
	b1 = max(y, b - (n - (a - a1)))
	ans1 = a1 * b1
	b2 = max(y, b - n)
	a2 = max(x, a - (n - (b - b2)))
	ans2 = a2 * b2
	print(min(ans1, ans2))


n = int(input())
o = []
for i in range(n):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	if n > a - x:
		s = x * max(y, b - n + a - x)
	else:
		s = (a - n) * b
	if n > b - y:
		t = y * max(x, a + b - n - y)
	else:
		t = (b - n) * a
	o += [min(s, t)]
print('\n'.join(map(str, o)))


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a - x
	b1 = b - y
	if a1 + b1 <= n:
		ans = x * y
	else:
		minv = min(a, b)
		if a == minv:
			if a - x >= n:
				ans = (a - n) * b
			else:
				n1 = n - (a - x)
				if n1 < 0:
					n1 = 0
					x = a - n
				ans1 = x * (b - n1)
				n2 = n - (b - y)
				if n2 < 0:
					n2 = 0
					y = b - n
				ans2 = y * (a - n2)
				ans = min(ans1, ans2)
		elif b - y >= n:
			ans = (b - n) * a
		else:
			n1 = n - (a - x)
			if n1 < 0:
				n1 = 0
				x = a - n
			ans1 = x * (b - n1)
			n2 = n - (b - y)
			if n2 < 0:
				n2 = 0
				y = b - n
			ans2 = y * (a - n2)
			ans = min(ans1, ans2)
	print(ans)


for _ in range(int(input())):
	arr = [int(i) for i in input().split()]
	a = arr[0]
	b = arr[1]
	x = arr[2]
	y = arr[3]
	n = arr[4]
	ans = 10 ** 20
	for i in range(2):
		da = min(a - x, n)
		db = min(b - y, n - da)
		k = (a - da) * (b - db)
		ans = min(ans, k)
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


import math
import os
import random
import re
import string
from sys import *
from collections import *

def bs(arr, x, l, r):
	if l <= r:
		mid = (r + l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return bs(arr, x, l, mid - 1)
		else:
			return bs(arr, x, mid + 1, r)
	else:
		return -1

def solve():
	for _ in range(int(input())):
		(a, b, x, y, r) = map(int, stdin.readline().strip().split())
		d = a - x
		d += b - y
		if r >= d:
			print(x * y)
		else:
			a1 = max(a - r, x)
			b1 = max(b - r, y)
			if a1 <= b1:
				r -= a - a1
				b1 = b - r
				print(a1 * b1)
			else:
				r -= b - b1
				a1 = a - r
				print(a1 * b1)
solve()


def fun(a, b, x, y, n):
	sub = min(a - x, n)
	a -= sub
	n -= sub
	sub = min(b - y, n)
	b -= sub
	n -= sub
	return a * b

def main():
	T = eval(input())
	for cas in range(T):
		(a, b, x, y, n) = map(int, input().split())
		minn = 100000000000000000005
		minn = min(minn, fun(a, b, x, y, n))
		minn = min(minn, fun(b, a, y, x, n))
		print(minn)
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(d1, d2) = (a - x, b - y)
	if d1 + d2 <= n:
		print(x * y)
	else:
		if a - n >= x:
			l = a - n
		else:
			l = x
		if b - n >= y:
			u = b - n
		else:
			u = y
		if l < u:
			n -= a - l
			a = l
			b -= n
		else:
			n -= b - u
			b = u
			a -= n
		print(a * b)


from sys import stdin

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

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

def linput():
	return list(map(int, stdin.readline().split()))
from collections import defaultdict
from math import factorial
t = iinput()
while t:
	t -= 1
	(a, b, x, y, n) = minput()
	if b < a:
		(a, b) = (b, a)
		(x, y) = (y, x)
	mn = a * b
	if b - y >= n:
		mn = min(mn, a * (b - n))
	if a - x >= n:
		mn = min(mn, b * (a - n))
	diff = a - x
	if 0 <= diff <= n:
		A = x
		N = n - diff
		B = b
		if b > y:
			D = b - y
			B -= min(D, N)
		mn = min(mn, A * B)
	diff = b - y
	if 0 <= diff <= n:
		B = y
		N = n - diff
		A = a
		if a > x:
			D = a - x
			A -= min(D, N)
		mn = min(mn, A * B)
	print(min(mn, a * b))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a < b:
		(a, b) = (b, a)
		(x, y) = (y, x)
	d1 = a - x
	d2 = b - y
	if n >= d1 + d2:
		print(x * y)
	elif d2 >= n:
		print(a * (b - n))
	elif d1 >= n and a - n < y:
		print((a - n) * b)
	elif d1 < n and x < y:
		print(x * (b - n + d1))
	else:
		print((a - n + d2) * y)


t = int(input())
while t:
	(a, b, x, y, n) = map(int, input().split())
	(a1, b1, x1, y1, n1) = (b, a, y, x, n)
	asub = min(a - x, n)
	a -= asub
	n -= asub
	b = max(b - n, y)
	u = a * b
	asub = min(a1 - x1, n1)
	a1 -= asub
	n1 -= asub
	b1 = max(b1 - n1, y1)
	print(min(u, a1 * b1))
	t -= 1


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	a1 = 0
	temp = max(a - n, x)
	m1 = n - a + temp
	d = max(b - m1, y)
	a1 = temp * d
	m1 = n
	temp = max(b - m1, y)
	m1 -= b - temp
	d = max(a - m1, x)
	print(min(a1, temp * d))


n = int(input())
vn = list()
for qq in range(n):
	xx = list(map(int, input().split(' ')))
	a = xx[0]
	b = xx[1]
	x = xx[2]
	y = xx[3]
	n = xx[4]
	ta = a
	tb = b
	n2 = n
	qq = max(a - n, x)
	b = max(b - n + (a - qq), y)
	a = qq
	qq2 = max(tb - n2, y)
	ta = max(ta - n2 + (tb - qq2), x)
	tb = qq2
	print(min(a * b, ta * tb))


def solve():
	(_a, _b, x, y, _n) = [int(v) for v in input().split()]
	memo = {}

	def rec(ad, bd, n):
		if not n:
			return ad * bd
		if (ad, bd) in memo:
			return memo[ad, bd]
		l = float('inf')
		r = float('inf')
		if ad > x:
			diff = min(ad - x, n)
			l = rec(ad - diff, bd, n - diff)
		if bd > y:
			diff = min(bd - y, n)
			r = rec(ad, bd - diff, n - diff)
		memo[ad, bd] = min(l, r, ad * bd)
		return memo[ad, bd]
	print(rec(_a, _b, _n))
t = int(input())
for _ in range(t):
	solve()


def main():
	for test in range(int(input())):
		(num1, num2, lim1, lim2, lim) = map(int, input().split())
		print(solution(num1, num2, lim1, lim2, lim))

def solution(a, b, x, y, n):
	min_a = max(a - n, x)
	min_b = max(b - n, y)
	if min_a < min_b:
		n -= a - min_a
		min_b = b - n if b - n >= y else y
	else:
		n -= b - min_b
		min_a = a - n if a - n >= x else x
	return min_a * min_b
main()


d = int(input())
for i in range(d):
	(a, b, x, y, n) = [int(s) for s in input().split()]
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	flag = True
	d1 = []
	if flag:
		check = True
		aAns = a - x
		bAns = b - y
		if aAns < n:
			a = a - aAns
			n = n - aAns
		else:
			a = a - n
			check = False
		if check and n != 0:
			if bAns < n:
				b = b - bAns
				n = n - bAns
			else:
				b = b - n
		d1.append(a * b)
		(a, b, x, y, n) = (a1, b1, x1, y1, n1)
		check = True
		aAns = a - x
		bAns = b - y
		if bAns < n:
			b = b - bAns
			n = n - bAns
		else:
			b = b - n
			check = False
		if check and n != 0:
			if aAns < n:
				a = a - aAns
				n = n - aAns
			else:
				a = a - n
		d1.append(a * b)
		(a, b, x, y, n) = (a1, b1, x1, y1, n1)
		check = True
		aAns = a - x
		bAns = b - y
		if bAns < n:
			b = b - bAns
			n = n - bAns
		else:
			b = b - n
			check = False
		if check and n != 0:
			if aAns < n:
				a = a - aAns
				n = n - aAns
			else:
				a = a - n
		d1.append(a * b)
		(a, b, x, y, n) = (a1, b1, x1, y1, n1)
		check = True
		aAns = a - x
		bAns = b - y
		if aAns < n:
			a = a - aAns
			n = n - aAns
		else:
			a = a - n
			check = False
		if check and n != 0:
			if bAns < n:
				b = b - bAns
				n = n - bAns
			else:
				b = b - n
		d1.append(a * b)
		(a, b, x, y, n) = (a1, b1, x1, y1, n1)
		check = True
		aAns = a - x
		bAns = b - y
		if aAns < n:
			a = a - aAns
			n = n - aAns
		else:
			a = a - n
			check = False
		if check and n != 0:
			if bAns < n:
				b = b - bAns
				n = n - bAns
			else:
				b = b - n
		d1.append(a * b)
		print(min(d1))


import sys

def main():
	t = Iint()
	for _ in range(t):
		(a, b, x, y, n) = Imap()
		(ac, bc, nc) = (a, b, n)
		t = min(a - x, n)
		a -= t
		n -= t
		t = min(b - y, n)
		b -= t
		n -= t
		ans = a * b
		(a, b, n) = (ac, bc, nc)
		t = min(b - y, n)
		b -= t
		n -= t
		t = min(a - x, n)
		a -= t
		n -= t
		ans = min(ans, a * b)
		print(ans)
en = enumerate
FIO = 10
BUFSIZE = 8 * 1024

def Istr():
	return input()

def Iint():
	return int(input())

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

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

def Plist(li, s=' '):
	print(s.join(map(str, li)))

def debug(*args, c=6):
	pass
	print('\x1b[3{}m'.format(c), *args, '\x1b[0m', file=sys.stderr)
if not FIO:
	if __name__ == '__main__':
		main()
		exit()
else:
	from io import BytesIO, IOBase
	import os

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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


cases = int(input())
for i in range(cases):
	line = input().split(' ')
	a = int(line[0])
	b = int(line[1])
	x = int(line[2])
	y = int(line[3])
	n = int(line[4])
	sol = 0
	c1less = c2less = False
	c1 = a - n
	c2 = b - n
	if c1 <= x:
		c1 = x
	if c2 <= y:
		c2 = y
	if c1 < c2:
		c1less = True
	if c2 <= c1:
		c2less = True
	if c1less:
		n -= a - c1
		a = c1
		b -= n
		if b <= y:
			b = y
		sol = a * b
	if c2less:
		n -= b - c2
		b = c2
		a -= n
		if a <= x:
			a = x
		sol = a * b
	print(sol)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	ans1 = 0
	ans2 = 0
	k = n
	if a - x <= n:
		n = n - (a - x)
		if b - y <= n:
			ans1 = x * y
		else:
			ans1 = x * (b - n)
	else:
		ans1 = (a - n) * b
	n = k
	if b - y <= n:
		n = n - (b - y)
		if a - x <= n:
			ans2 = x * y
		else:
			ans2 = y * (a - n)
	else:
		ans2 = a * (b - n)
	if ans1 <= ans2:
		print(ans1)
	else:
		print(ans2)


def sm(a, b, x, y, n):
	temp = a - x
	temp1 = min(temp, n)
	a = a - temp1
	n = n - temp1
	b = b - n
	return a * b
q = int(input())
for d in range(q):
	(a, b, x, y, n) = map(int, input().split(' '))
	if n >= a - x + (b - y):
		print(x * y)
	else:
		ans1 = sm(a, b, x, y, n)
		ans2 = sm(b, a, y, x, n)
		print(min(ans1, ans2))


for t in range(int(input())):
	(a, b, x, y, n) = list(map(int, input().split()))
	m1 = 0
	m2 = 0
	m3 = 0
	m4 = 0
	if a - x >= n:
		m1 = b * (a - n)
	else:
		m1 = b * x
	if b - y >= n:
		m2 = a * (b - n)
	else:
		m2 = a * y
	if a - x >= n:
		m3 = b * (a - n)
	elif b - (n - (a - x)) < y:
		m3 = y * x
	else:
		m3 = (b - (n - (a - x))) * x
	if b - y >= n:
		m4 = a * (b - n)
	elif a - (n - (b - y)) < x:
		m4 = x * y
	else:
		m4 = (a - (n - (b - y))) * y
	print(min(m1, m2, m3, m4))


import math

def main():
	(a, b, x, y, n) = map(int, input().strip().split())
	minProduct = math.inf
	for _ in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		minProduct = min(minProduct, (a - da) * (b - db))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(minProduct)
for _ in range(int(input())):
	main()


for _ in range(int(input())):
	inp = [int(i) for i in input().split(' ')]
	a = inp[0]
	b = inp[1]
	x = inp[2]
	y = inp[3]
	n = inp[4]
	a = max(x, a - n)
	n -= inp[0] - a
	b = max(y, b - n)
	n -= inp[1] - b
	sl1 = a * b
	a = inp[0]
	b = inp[1]
	n = inp[4]
	b = max(y, b - n)
	n -= inp[1] - b
	a = max(x, a - n)
	n -= inp[0] - a
	sl2 = a * b
	print(min(sl1, sl2))


from math import *
from copy import *
from string import *
from random import *
from sys import stdin, stdout
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
import math
import time
from queue import Queue

def seive(n):
	l = [True]
	l = l * (n + 1)
	for i in range(2, int(sqrt(n)) + 1):
		if l[i] == True:
			val = i * i
			while val < len(l):
				l[val] = False
				val += i
	prime = []
	for i in range(2, len(l)):
		if l[i] == True:
			prime.append(i)
	return prime

def dp(l, i, n, val, ans):
	if i >= n or val < 0:
		return 1000000
	elif val == 0:
		return 0
	else:
		if ans[i] == 1000000:
			ans[i] = min(min(1 + dp(l, i + 1, n, val - l[i], ans), 1 + dp(l, i, n, val - l[i], ans)), dp(l, i + 1, n, val, ans))
		return ans[i]
from queue import Queue

def factors(n):
	l = []
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def check1(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v -= 1

def check2(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v += 1

def up(n):
	j = n - 1
	while j > 0:
		if n % j == 0:
			break
		j -= 1
	return j

def fac(n):
	c = 1
	i = 1
	while i <= n:
		c *= i
		i += 1
	return c

def check_happy(n):
	ss = set()
	print(n)
	while n != 1:
		val = n
		s = 0
		print(val)
		while val != 0:
			s += (val % 10) ** 2
			val = val // 10
		print(val)
		print('hi')
		if val in ss:
			return False
		else:
			n = val
			ss.add(n)
	return True

def update(a, b):
	c = 1
	val = a
	while a < b:
		print(c, a)
		c += c
		a += a
	print(1)
	while a > b:
		print()
		a -= val
		c -= 1
	return c
import random as rand

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
from itertools import permutations

def insertion_sort(arr):
	for i in range(len(arr)):
		j = i
		while j > 0:
			if arr[j] < arr[j - 1]:
				temp = arr[j]
				arr[j] = arr[j - 1]
				arr[j - 1] = temp
			j -= 1
	return arr

def quick_sort(arr, low, high):
	i = low
	j = high
	while i < j:
		if arr[i] > arr[low] and arr[j] < arr[low]:
			temp = arr[i]
			arr[i] = arr[j]
			arr[j] = arr[i]
			i += 1
			j -= 1
		elif arr[i] <= arr[low]:
			i += 1
		elif arr[j] >= arr[low]:
			j -= 1
	print(i, j)
	toto = arr[j]
	arr[j] = arr[low]
	arr[low] = toto
	return j

def dodo(arr, low, high):
	if low < high:
		val = quick_sort(arr, low, high)
		dodo(arr, low, val - 1)
		dodo(arr, val + 1, high)

def dp(arr, c, n, k, z, ans):
	if k == 0:
		return ans
	elif c == 0:
		return dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1])
	elif c == n - 1:
		if z == 0:
			return 0
		else:
			return dp(arr, c - 1, n, k - 1, z - 1, ans + arr[c - 1])
	elif z == 0:
		return dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1])
	else:
		return max(dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1]), dp(arr, c - 1, n, k - 1, z - 1, ans + arr[c - 1]))

def check(arr, val):
	a = -1
	for i in range(len(arr)):
		if arr[i][len(arr[i]) - 1] == val:
			a = i
			break
	return a

def reverse(s, i, ans):
	if i >= len(s):
		return ans
	else:
		return reverse(s, i + 1, s[i] + ans)

def update(arr, i, j, n, m):
	if i >= 0 and i < n and (j >= 0) and (j < m):
		if arr[i][j] == 1:
			arr[i][j] == 2
			return [i, j]
	return [-1, -1]

def mergesort(arr):
	n = len(arr)
	if n == 1:
		return arr
	else:
		n = n // 2
		a1 = arr[0:n]
		a2 = arr[n:len(arr)]
		l1 = mergesort(a1)
		l2 = mergesort(a2)
		return merge(l1, l2)

def merge(arr1, arr2):
	i1 = 0
	i2 = 0
	res = []
	n1 = len(arr1)
	n2 = len(arr2)
	while i1 < n1 and i2 < n2:
		if arr1[i1] <= arr2[i2]:
			res.append(arr1[i1])
			i1 += 1
		else:
			res.append(arr2[i2])
			i2 += 1
	while i1 < n1:
		res.append(arr1[i1])
		i1 += 1
	while i2 < n2:
		res.append(arr2[i2])
		i2 += 1
	return res

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1

def method1(a, b, x, y, n):
	val = b - y
	if val >= n:
		b = b - n
	else:
		b = y
		n -= val
		val = a - x
		if val >= n:
			a -= n
		else:
			a = x
	return a * b

def method2(a, b, x, y, n):
	val = a - x
	if val >= n:
		a -= n
	else:
		a = x
		n -= val
		val = b - y
		if val >= n:
			b -= n
		else:
			b = y
	return a * b
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	print(min(method1(a, b, x, y, n), method2(a, b, x, y, n)))


from sys import stdin

def input():
	return stdin.readline().rstrip()
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	amin = max(x, a - n)
	bmin = max(y, b - n)
	z = 0
	if amin < bmin:
		if x > a - n:
			z = x - (a - n)
		a = max(x, a - n)
		b -= z
	else:
		if y > b - n:
			z = y - (b - n)
		b = max(y, b - n)
		a -= z
	a = max(a, x)
	b = max(b, y)
	print(a * b)


T = int(input())
for _ in range(T):
	(a, b, x, y, n) = map(int, input().split())
	answer = []
	if a - x >= n:
		answer.append((a - n) * b)
	else:
		answer.append(x * max(y, b - (n - a + x)))
	if b - y >= n:
		answer.append((b - n) * a)
	else:
		answer.append(y * max(x, a - (n - b + y)))
	print(min(answer))


import math
from decimal import *
import random
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = int(1e+20)
	(a1, b1, x1, y1, n1) = (int(a), int(b), int(x), int(y), int(n))
	sub1 = min(a1 - x1, n1)
	a1 -= sub1
	n1 -= sub1
	if n1 > 0:
		sub1 = min(b1 - y1, n1)
		b1 -= sub1
		n1 -= sub1
	ans = min(ans, a1 * b1)
	(a1, b1, x1, y1, n1) = (int(a), int(b), int(x), int(y), int(n))
	sub1 = min(b1 - y1, n1)
	b1 -= sub1
	n1 -= sub1
	if n1 > 0:
		sub1 = min(a1 - x1, n1)
		a1 -= sub1
		n1 -= sub1
	ans = min(ans, a1 * b1)
	print(ans)


testcases = int(input())
for testcase in range(testcases):
	temparr = input()
	temparr = temparr.split()
	a = int(temparr[0])
	b = int(temparr[1])
	x = int(temparr[2])
	y = int(temparr[3])
	n = int(temparr[4])
	aa = a
	bb = b
	xx = x
	yy = y
	nn = n
	maxs = a * b
	if a - n >= x and b - n >= y and (a - n <= b - n):
		a -= n
		print(a * b)
		continue
	elif a - n >= x and b - n >= y and (a - n > b - n):
		b -= n
		print(a * b)
		continue
	a = aa
	b = bb
	x = xx
	y = yy
	n = nn
	diff = a - x
	if diff > n:
		a -= n
		n = 0
	else:
		a = x
		n -= diff
	b -= n
	if b < y:
		b = y
	ans1 = a * b
	a = aa
	b = bb
	x = xx
	y = yy
	n = nn
	diff = b - y
	if diff > n:
		b -= n
		n = 0
	else:
		b = y
		n -= diff
	a -= n
	if a < x:
		a = x
	ans2 = a * b
	print(min(ans1, ans2))


import sys
input = sys.stdin.readline
t = int(input())
while t != 0:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	ma = max(a - n, x)
	mb = max(b - n, y)
	if ma < mb:
		ln = n - (a - ma)
		b = max(b - ln, y)
		print(ma * b)
	else:
		ln = n - (b - mb)
		a = max(a - ln, x)
		print(mb * a)


def solve():
	(a, b, x, y, n) = map(int, input().split())
	arr = [0] * 2
	(ta, tb, tx, ty, tn) = (a, b, x, y, n)
	tn -= ta - tx
	ta -= ta - tx
	if tn < 0:
		ta -= tn
	else:
		tn -= tb - ty
		tb -= tb - ty
		if tn < 0:
			tb -= tn
	arr[0] = ta * tb
	(tb, ta, ty, tx, tn) = (a, b, x, y, n)
	tn -= ta - tx
	ta -= ta - tx
	if tn < 0:
		ta -= tn
	else:
		tn -= tb - ty
		tb -= tb - ty
		if tn < 0:
			tb -= tn
	arr[1] = ta * tb
	print(min(arr))
t = int(input())
for x in range(t):
	solve()


import sys
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = list(map(int, input().split()))
	(c, d, e, f, g) = (a, b, x, y, n)
	best = 10 ** 99
	z = min(b - y, n)
	b -= z
	n -= z
	z = min(a - x, n)
	a -= z
	best = min(best, a * b)
	(a, b, x, y, n) = (d, c, f, e, g)
	z = min(b - y, n)
	b -= z
	n -= z
	z = min(a - x, n)
	a -= z
	best = min(best, a * b)
	print(best)


t = int(input())
while t > 0:
	(a, b, x, y, n) = list(map(int, input().split()))
	n = min(n, a - x + (b - y))
	if a - n >= x:
		prod1 = (a - n) * b
	else:
		prod1 = x * (b - n + (a - x))
	if b - n >= y:
		prod2 = (b - n) * a
	else:
		prod2 = y * (a - n + (b - y))
	print(min(prod1, prod2))
	t -= 1


import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())

	def f1(a, b, x, y, n):
		p = a - x
		q = b - y
		if p > q:
			x1 = min(a - x, n)
			n -= x1
			a -= x1
			if n > 0:
				x1 = min(n, b - y)
				b -= x1
			return a * b
		elif q > p:
			x1 = min(b - y, n)
			n -= x1
			b -= x1
			if n > 0:
				x1 = min(n, a - x)
				a -= x1
			return a * b
		elif x > y:
			x1 = min(n, b - y)
			b -= x1
			n -= x1
			if n > 0:
				x1 = min(n, a - x)
				a -= x1
			return a * b
		elif x < y:
			x1 = min(n, a - x)
			a -= x1
			n -= x1
			if n > 0:
				x1 = min(n, b - y)
				b -= x1
			return a * b
		else:
			x1 = min(a - x, n)
			a -= x1
			n -= x1
			x1 = min(b - y, n)
			b -= x1
			n -= x1
			return a * b

	def f2(a, b, x, y, n):
		if a < b:
			x1 = min(a - x, n)
			n -= x1
			a -= x1
			if n > 0:
				x1 = min(n, b - y)
				b -= x1
			return a * b
		elif b < a:
			x1 = min(b - y, n)
			n -= x1
			b -= x1
			if n > 0:
				x1 = min(n, a - x)
				a -= x1
			return a * b
		elif x > y:
			x1 = min(n, b - y)
			b -= x1
			n -= x1
			if n > 0:
				x1 = min(n, a - x)
				a -= x1
			return a * b
		elif x < y:
			x1 = min(n, a - x)
			a -= x1
			n -= x1
			if n > 0:
				x1 = min(n, b - y)
				b -= x1
			return a * b
		else:
			x1 = min(a - x, n)
			a -= x1
			n -= x1
			x1 = min(b - y, n)
			b -= x1
			n -= x1
			return a * b
	print(min(f1(a, b, x, y, n), f2(a, b, x, y, n)))


for t in range(0, int(input())):
	(a, b, x, y, n) = map(int, input().strip().split())
	if a > b:
		temp = a
		a = b
		b = temp
		temp2 = x
		x = y
		y = temp2
	if a <= b:
		c = a
		d = b
		o = a - x
		if o <= n:
			a = x
			ob = b - y
			if ob <= n - o:
				b = y
			else:
				b = b - (n - o)
		else:
			a = a - n
		o = d - y
		if o <= n:
			d = y
			ob = c - x
			if ob <= n - o:
				c = x
			else:
				c = c - (n - o)
		else:
			d = d - n
	print(min(c * d, a * b))


import math
import sys
input = sys.stdin.readline

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

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

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

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

def pbb(a, b, x, y, n):
	da = min(a - x, n)
	a -= da
	n -= da
	db = min(b - y, n)
	b -= db
	return a * b
t = inp()
for i in range(t):
	(a, b, x, y, n) = invar()
	print(min(pbb(a, b, x, y, n), pbb(b, a, y, x, n)))


m = int(input())
for i in range(m):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	l = []
	if b - y < n:
		n1 = y
		if a - x < n - (b - y):
			n2 = x
		else:
			n2 = a - (n - (b - y))
		p1 = n1 * n2
	else:
		n1 = b - n
		p1 = a * n1
	if a - x < n:
		n2 = x
		if b - y < n - (a - x):
			n1 = y
		else:
			n1 = b - (n - (a - x))
		p2 = n1 * n2
	else:
		n2 = a - n
		p2 = b * n2
	m = min(p1, p2)
	print(m)


def do(a, b, x, y, n):
	if b > a:
		(b, a) = (a, b)
		(x, y) = (y, x)
	aLow = a - x
	bLow = b - y
	minP = a * b
	if bLow >= n:
		d = a * (b - n)
		if d < minP:
			minP = d
	if aLow >= n:
		d = b * (a - n)
		if d < minP:
			minP = d
	if bLow + aLow >= n:
		if bLow <= n:
			d = (a - n + bLow) * (b - bLow)
			if d < minP:
				minP = d
		if aLow <= n:
			d = (a - aLow) * (b - n + aLow)
			if d < minP:
				minP = d
	if bLow + aLow <= n:
		d = (a - aLow) * (b - bLow)
		if d < minP:
			minP = d
	print(minP)
t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	do(a, b, x, y, n)


def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = mpos(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def graph(n, m):
	adj = dict()
	for i in range(1, n + 1):
		adj.setdefault(i, 0)
	for i in range(m):
		(a, b) = map(int, input().split())
		adj[a] += 1
		adj[b] += 1
	return adj
import sys
import threading
from math import *
sys.setrecursionlimit(300000)
threading.stack_size(10 ** 8)
po = int(log(10 ** 18)) + 2
li = []
for i in range(po):
	li.append(3 ** i)
li = li[::-1]
s = sum(li)
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	d1 = a - x
	d2 = b - y
	if d1 + d2 <= n:
		print(x * y)
	else:
		newa = max(x, a - n)
		used = a - newa
		newb = b - n + used
		ans1 = newa * newb
		newb = max(y, b - n)
		used = b - newb
		newa = a - n + used
		ans2 = newb * newa
		print(min(ans1, ans2))


def solve(a, b, x, y, n):
	da = a - x
	db = b - y
	if da > n:
		max_da = n
	else:
		max_da = da
	if db > n:
		max_db = n
	else:
		max_db = db
	if a - max_da < b - max_db:
		a = a - max_da
		if n - max_da < db:
			db = n - max_da
		b = b - db
	else:
		b = b - max_db
		if n - max_db < da:
			da = n - max_db
		a = a - da
	return a * b
t = int(input())
for i in range(t):
	(a, b, x, y, n) = (int(x) for x in input().split())
	print(solve(a, b, x, y, n))


def algo(a, b, x, y, n):
	(d1, d2) = (a - x, b - y)
	if n >= d1 + d2:
		return x * y
	if d1 >= n and d2 >= n:
		if a > b:
			return a * (b - n)
		else:
			return (a - n) * b
	elif d1 < n and d2 >= n:
		if a > b:
			return a * (b - n)
		else:
			return min(x * (b - (n - d1)), a * (b - n))
	elif d2 < n and d1 >= n:
		if a > b:
			return min(y * (a - (n - d2)), b * (a - n))
		else:
			return b * (a - n)
	else:
		return min(x * (b - (n - d1)), y * (a - (n - d2)))
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = algo(a, b, x, y, n)
	print(ans)


import math
for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	z = a - x
	w = b - y
	if max(a - n, x) < max(b - n, y):
		a -= min(n, z)
		n -= min(n, z)
		if n > 0:
			b -= min(n, w)
			n -= min(n, w)
	else:
		b -= min(n, w)
		n -= min(n, w)
		if n > 0:
			a -= min(n, z)
			n -= min(n, z)
	print(a * b)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	n1 = n
	(a1, b1) = (a, b)
	if a - n >= x:
		ans1 = (a - n) * b
		min1 = ans1
	else:
		n = n - (a - x)
		a = x
		if b - n >= y:
			ans2 = a * (b - n)
			min1 = ans2
		else:
			n = n - (b - y)
			b = y
			ans3 = a * b
			min1 = ans3
	n = n1
	(a, b) = (a1, b1)
	if b - n >= y:
		ans1 = (b - n) * a
		min2 = ans1
	else:
		n = n - (b - y)
		b = y
		if a - n >= x:
			ans2 = b * (a - n)
			min2 = ans2
		else:
			n = n - (b - y)
			a = x
			ans3 = a * b
			min2 = ans3
	print(min(min1, min2))


test = int(input())
for belt in range(test):
	(a, b, x, y, n) = map(int, input().split())
	ans = []
	if a - x + (b - y) < n:
		ans.append(x * y)
	else:
		if a - x >= n:
			ans.append((a - n) * b)
		if b - y >= n:
			ans.append((b - n) * a)
		if b - n >= y:
			ans.append(a * (b - n))
		else:
			ans.append((a - n + b - y) * y)
		if a - n > x:
			ans.append(b * (a - n))
		else:
			ans.append((b - n + a - x) * x)
	print(min(ans))


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	d1 = a - x
	d2 = b - y
	n1 = n
	p1 = max(x, a - n)
	n = n - (a - p1)
	if n != 0:
		mi = p1 * max(y, b - n)
	else:
		mi = p1 * b
	p2 = max(y, b - n1)
	n1 = n1 - (b - p2)
	if n1 != 0:
		mi = min(mi, p2 * max(x, a - n1))
	else:
		mi = min(mi, p2 * a)
	print(mi)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y < n:
		print(x * y)
		continue
	res = []
	tmp = min(a - x, n)
	r1 = (a - tmp) * (b - n + tmp)
	res.append(r1)
	tmp = min(b - y, n)
	r2 = (a - n + tmp) * (b - tmp)
	res.append(r2)
	print(min(res))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split(' '))
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	ans = 2e+18
	if a1 - x1 > n1:
		a1 -= n1
		n1 = 0
	else:
		n1 -= a1 - x1
		a1 = x1
	if n1 > 0:
		b1 -= n1
		b1 = max(b1, y1)
	ans = min(ans, a1 * b1)
	(a1, b1, x1, y1, n1) = (a, b, x, y, n)
	if b1 - y1 > n1:
		b1 -= n1
		n1 = 0
	else:
		n1 -= b1 - y1
		b1 = y1
	if n1 > 0:
		a1 -= n1
		a1 = max(a1, x1)
	ans = min(ans, a1 * b1)
	print(ans)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if n >= a - x + (b - y):
		print(x * y)
	elif a >= b and n <= b - y:
		print(a * (b - n))
	elif b > a and n <= a - x:
		print((a - n) * b)
	elif n <= a - x and n <= b - y:
		print(min((a - n) * b, a * (b - n)))
	else:
		if n > a - x:
			qq = x * (b - (n - (a - x)))
		else:
			qq = (a - n) * b
		if n > b - y:
			qq2 = (a - (n - (b - y))) * y
		else:
			qq2 = a * (b - n)
		print(min(qq, qq2))


import sys
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.141592653589793

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

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

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

def read_ints2(x):
	return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())

def read_str_list():
	return list(sys.stdin.readline().strip().split())

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

def GCD(a: int, b: int) -> int:
	return b if a % b == 0 else GCD(b, a % b)

def LCM(a: int, b: int) -> int:
	return a * b // GCD(a, b)

def Main():
	for _ in range(read_int()):
		(a, b, x, y, n) = read_ints()
		d = max(0, n - a + x)
		ans = max(x, a - n) * max(y, b - d)
		d = max(0, n - b + y)
		ans = min(ans, max(y, b - n) * max(x, a - d))
		print(ans)
Main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	a1 = a
	b1 = b
	b1 -= n
	if b1 < y:
		a1 -= y - b1
		b1 = y
	if b1 < y:
		b1 = y
	if a1 < x:
		a1 = x
	val1 = a1 * b1
	a -= n
	if a < x:
		b -= x - a
		a = x
	if a < x:
		a = x
	if b < y:
		b = y
	print(min(a * b, val1))


from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
from math import sqrt
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

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

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

def sin():
	return input()

def inin():
	return int(input())

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

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

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

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

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	for _ in range(inin()):
		(a, b, x, y, n) = map(int, input().split())
		q1 = max(a - n, x)
		l1 = n - a + q1
		p1 = max(b - l1, y)
		ans1 = p1 * q1
		q2 = max(b - n, y)
		l2 = n - b + q2
		p2 = max(a - l2, x)
		ans2 = p2 * q2
		print(min(ans1, ans2))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

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


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	aa = 0
	bb = 0
	if a - n >= x:
		aa += b * (a - n)
	elif b - (n - (a - x)) < y:
		aa += x * y
	elif b - (n - (a - x)) >= y:
		aa += x * (b - (n - (a - x)))
	if b - n >= y:
		bb += a * (b - n)
	elif a - (n - (b - y)) < x:
		bb += y * x
	elif a - (n - (b - y)) >= x:
		bb += y * (a - (n - (b - y)))
	print(min(aa, bb))


from sys import stdin
tt = int(stdin.readline())
for loop in range(tt):
	(a, b, x, y, n) = map(int, stdin.readline().split())
	ans = float('inf')
	if a - x + b - y < n:
		print(x * y)
		continue
	if a - x >= n:
		ans = min(ans, (a - n) * b)
	else:
		rem = n - (a - x)
		ans = min(ans, x * (b - rem))
	if b - y >= n:
		ans = min(ans, (b - n) * a)
	else:
		rem = n - (b - y)
		ans = min(ans, y * (a - rem))
	print(ans)


t = int(input())
for t in range(t):
	(p, q, x, y, n) = map(int, input().split())
	q1 = min(q - y, n)
	p1 = min(p - x, n)
	if p - p1 < q - q1:
		if p - x >= n:
			n = 0
		else:
			n -= p1
		print((p - p1) * (q - min(q - y, n)))
	else:
		if q - y >= n:
			n = 0
		else:
			n -= q1
		print((q - q1) * (p - min(p - x, n)))


for _ in range(int(input())):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	c = a
	z = x
	if a >= b:
		a = b
		x = y
		b = c
		y = z
	n1 = n
	(i, j, m, o) = [-1, -1, -1, -1]
	i = max(x, a - n1)
	n1 -= a - i
	j = max(y, b - n1)
	n1 -= b - j
	n2 = n
	o = max(y, b - n2)
	n2 -= b - o
	m = max(x, a - n2)
	n2 -= a - m
	dummy1 = i * j
	dummy2 = m * o
	print(min(dummy1, dummy2))


T = int(input())
for i in range(T):
	(a, b, x, y, n) = [int(s) for s in input().split()]
	m = min(a + b - x - y, n)
	minValue = max(m - b + y, 0)
	maxValue = min(m, a - x)
	p1 = (a - minValue) * (b - m + minValue)
	p2 = (a - maxValue) * (b - m + maxValue)
	print(min(p1, p2))


def mult(a, b, x, y, n):
	na = x if a - n < x else a - n
	n -= a - na
	nb = y if b - n < y else b - n
	return na * nb
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	res1 = mult(a, b, x, y, n)
	res2 = mult(b, a, y, x, n)
	print(res1 if res1 < res2 else res2)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	(_a, _b) = (a - x, b - y)
	if a - min(n, _a) < b - min(n, _b):
		m = min(n, _a)
		a -= m
		n -= m
		if n != 0:
			m = min(n, _b)
			b -= m
			n -= m
	else:
		m = min(n, _b)
		b -= m
		n -= m
		if n != 0:
			m = min(n, _a)
			a -= m
			n -= m
	print(a * b)


t = int(input())
while t:
	t -= 1
	(a, b, x, y, n) = map(int, input().split())
	if max(x, a - n) > max(y, b - n):
		b2 = max(y, b - n)
		n = n - b + b2
		a = max(x, a - n)
		print(b2 * a)
	else:
		a2 = max(x, a - n)
		n = n - a + a2
		b = max(y, b - n)
		print(a2 * b)


def compute_min_product(data_list):
	a = int(data_list[0])
	b = int(data_list[1])
	x = int(data_list[2])
	y = int(data_list[3])
	n = int(data_list[4])
	if n >= a - x:
		a_min = x
	else:
		a_min = a - n
	if n >= b - y:
		b_min = y
	else:
		b_min = b - n
	b_op = n - (a - a_min)
	if b_op >= b - y:
		t1 = a_min * b_min
	else:
		t1 = a_min * (b - b_op)
	a_op = n - (b - b_min)
	if a_op >= a - x:
		t2 = b_min * a_min
	else:
		t2 = b_min * (a - a_op)
	if t1 < t2:
		return t1
	else:
		return t2
inputs_n = int(input())
inputs_list = []
while inputs_n > 0:
	input_data = input().split(' ')
	inputs_list.append(input_data)
	inputs_n -= 1
for i in inputs_list:
	print(compute_min_product(i))


t = int(input())
for i in range(t):
	string = input()
	(a, b, x, y, n) = list(map(int, string.split()))
	if n >= a + b - x - y:
		print(x * y)
	else:
		if n >= a - x:
			num1 = x * (b - (n - (a - x)))
		else:
			num1 = (a - n) * b
		if n >= b - y:
			num2 = y * (a - (n - (b - y)))
		else:
			num2 = a * (b - n)
		print(min(num1, num2))


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = [int(x) for x in input().split()]
	da = a - x
	db = b - y
	possible = []
	if da >= n:
		possible.append((a - n) * b)
	if da < n:
		possible.append(x * max(b - (n - (a - x)), y))
	(a, b) = (b, a)
	(x, y) = (y, x)
	(da, db) = (db, da)
	if da >= n:
		possible.append((a - n) * b)
	if da < n:
		possible.append(x * max(b - (n - (a - x)), y))
	print(min(possible))


def calc(a, x, n):
	ar = max(a - n, x)
	nr = n - a + ar
	return (ar, nr)
for t in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(ar, nr) = calc(a, x, n)
	(br, nr) = calc(b, y, nr)
	(bl, nl) = calc(b, y, n)
	(al, nl) = calc(a, x, nl)
	print(min(ar * br, al * bl))


for T in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	(c, d, n1) = (a, b, n)
	check = []
	m = min(n, a - x)
	a -= m
	n -= m
	b -= min(n, b - y)
	check.append(a * b)
	m = min(n1, d - y)
	d -= m
	n1 -= m
	c -= min(n1, c - x)
	check.append(c * d)
	print(min(check))


def a_extreme(a, b, x, y, n):
	d1 = a - x
	d2 = b - y
	if n > d1:
		a = x
		n -= d1
		if n > d2:
			b = y
			n -= d2
		else:
			b = b - n
			n = 0
	else:
		a = a - n
		n = 0
	return (a, b)

def b_extreme(a, b, x, y, n):
	d1 = a - x
	d2 = b - y
	if n > d2:
		b = y
		n -= d2
		if n > d1:
			a = x
			n -= d1
		else:
			a = a - n
			n = 0
	else:
		b = b - n
		n = 0
	return (a, b)
t = int(input())
for _ in range(t):
	(a, b, x, y, n) = map(int, input().split())
	initial_difference = a - b
	(aa, ba) = a_extreme(a, b, x, y, n)
	(ab, bb) = b_extreme(a, b, x, y, n)
	print(min(aa * ba, ab * bb))


def srt_b(a, b, n):
	if diff_b < n:
		n -= diff_b
		b = y
		if diff_a < n:
			a = x
		else:
			a -= n
	else:
		b -= n
	return (a, b)

def srt_a(a, b, n):
	if diff_a < n:
		n -= diff_a
		a = x
		if diff_b < n:
			b = y
		else:
			b -= n
	else:
		a -= n
	return (a, b)
T = int(input())
for i in range(T):
	(a, b, x, y, n) = map(int, input().split())
	diff_a = a - x
	diff_b = b - y
	diff_1 = srt_a(a, b, n)
	diff_2 = srt_b(a, b, n)
	print(min(diff_1[0] * diff_1[1], diff_2[0] * diff_2[1]))


import math
import sys
from collections import deque
import heapq

def inp():
	return sys.stdin.readline().rstrip()

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

def lis():
	return list(mpp())

def sol(a, b, x, y, n):
	if a - n >= x:
		a = a - n
		return a * b
	else:
		n = n - (a - x)
		newb = b - n if b - n >= y else y
		return x * newb

def main():
	t = int(inp())
	for _ in range(t):
		(a, b, x, y, n) = mpp()
		print(min(sol(b, a, y, x, n), sol(a, b, x, y, n)))
main()


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

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

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

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

def invr():
	return map(int, input().split())
test_count = inp()
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	(a, b, x, y, n) = invr()
	d1 = max(a - n, x)
	d2 = max(b - n, y)
	if d1 <= d2:
		d2 = max(y, b - (n - min(n, a - x)))
	else:
		d1 = max(x, a - (n - min(n, b - y)))
	print(d1 * d2)


from pathlib import Path
import sys
import functools
import itertools
import re

def solve():
	t = int(input())
	for test in range(0, t):
		(a, b, x, y, n) = map(int, input().split())
		k = y + n - b
		k = max(k, 0)
		k = min(k, n)
		ans = 10000000000000000000
		if a - k >= x and b - n + k >= y:
			ans = min(ans, (a - k) * (b - n + k))
		else:
			u = max(a - k, x)
			v = max(b - n + k, y)
			ans = min(ans, u * v)
		k = a - x
		k = min(k, n)
		k = max(k, 0)
		if a - k >= x and b - n + k >= y:
			ans = min(ans, (a - k) * (b - n + k))
		else:
			u = max(a - k, x)
			v = max(b - n + k, y)
			ans = min(ans, u * v)
		k = a - b + n
		k = max(k, 0)
		k = min(k, n)
		if a - k >= x and b - n + k >= y:
			ans = min(ans, (a - k) * (b - n + k))
		else:
			u = max(a - k, x)
			v = max(b - n + k, y)
			ans = min(ans, u * v)
		print(ans)

def main():
	if Path('test.inp').exists():
		sys.stdin = open('test.inp', 'r')
	solve()
main()


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	m = n
	a_ = max(a - n, x)
	n -= a - a_
	b_ = max(b - n, y)
	n -= b - b_
	v1 = a_ * b_
	(a, b, x, y) = (b, a, y, x)
	n = m
	a_ = max(a - n, x)
	n -= a - a_
	b_ = max(b - n, y)
	n -= b - b_
	v2 = a_ * b_
	print(min(v1, v2))


def solve22(a, b, x, y, n):
	minuser = x if a - x >= n else a - x
	a -= minuser
	n -= minuser
	minuser = y if b - y >= n else b - y
	b -= minuser
	return a * b

def solve2(a, b, x, y, n):
	ans1 = solve(a, b, x, y, n)
	ans2 = solve(b, a, y, x, n)
	print('answers ', ans1, ans2)
	ans = min(ans1, ans2)
	print(ans)

def solve3(a, b, x, y, n):
	if a - x > b - y:
		if a - x < n:
			a -= a - x
			n -= a - x
			if b - y < n:
				b -= b - y
				n -= b - y
			elif b - y > n:
				b -= n
				n -= n
		elif a - x >= n:
			a -= n
			n -= n
	elif b - y < n:
		b -= b - y
		n -= b - y
	elif b - y >= n:
		b -= n
		n -= n
	return a * b

def solve44(a, b, x, y, n):
	minuser = min(a - x, n)
	a -= minuser
	n -= minuser
	minuser = min(b - y, n)
	b -= minuser
	n -= minuser
	return a * b

def solve4(a, b, x, y, n):
	return min(solve44(a, b, x, y, n), solve44(b, a, y, x, n))
for testcases in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(solve4(a, b, x, y, n))


for i in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	max_for_a = max(a - n, x)
	max_for_b = max(b - n, y)
	if max_for_a < max_for_b:
		n = n - (a - max_for_a)
		a = max_for_a
		b = max(b - n, y)
	else:
		n = n - (b - max_for_b)
		b = max_for_b
		a = max(a - n, x)
	print(a * b)


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = input().split()
	(a1, b1, x1, y1, n1) = (int(a), int(b), int(x), int(y), int(n))
	(a2, b2, x2, y2, n2) = (int(a), int(b), int(x), int(y), int(n))
	ans = []
	if a1 - n1 < x1:
		n1 = n1 - (a1 - x1)
		a1 = x1
		if b1 - n1 < y1:
			b1 = y1
		else:
			b1 = b1 - n1
	else:
		a1 = a1 - n1
	ans.append(a1 * b1)
	if b2 - n2 < y2:
		n2 = n2 - (b2 - y2)
		b2 = y2
		if a2 - n2 < x2:
			a2 = x2
		else:
			a2 = a2 - n2
	else:
		b2 = b2 - n2
	ans.append(a2 * b2)
	print(min(ans))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	if a - x + (b - y) <= n:
		a = x
		b = y
		t1 = a * b
	else:
		k = a
		k2 = b
		k3 = n
		if a - x <= n:
			n -= a - x
			a = x
		else:
			a -= n
			n = 0
		if b - y <= n:
			n -= b - y
			b = y
		else:
			b -= n
			n = 0
		t1 = a * b
		a = k
		b = k2
		n = k3
		if b - y <= n:
			n -= b - y
			b = y
		else:
			b -= n
			n = 0
		if a - x <= n:
			n -= a - x
			a = x
		else:
			a -= n
			n = 0
		t1 = min(t1, a * b)
	print(t1)


for x in range(int(input())):
	(a, b, x, y, n) = map(int, input().strip().split()[:5])
	p = n
	k = max(x, a - n)
	p = p - (a - k)
	a1 = k
	b1 = max(y, b - p)
	ans1 = a1 * b1
	k = max(y, b - n)
	n = n - (b - k)
	b2 = k
	a2 = max(x, a - n)
	ans2 = a2 * b2
	print(min(ans1, ans2))


n = int(input())
for i in range(n):
	(a, b, x, y, n) = map(int, input().split())
	ans = float('inf')
	if a - x >= n:
		ans1 = (a - n) * b
	elif b - (n - (a - x)) >= y:
		ans1 = x * (b - (n - (a - x)))
	else:
		ans1 = x * y
	if b - n >= y:
		ans2 = (b - n) * a
	elif a - (n - (b - y)) >= x:
		ans2 = y * (a - (n - (b - y)))
	else:
		ans2 = x * y
	print(min(ans1, ans2))


import sys
for _ in range(int(input())):
	(a, b, x, y, n) = [int(i) for i in input().split()]
	ans = 999999999999999999999
	for _ in range(2):
		da = min(n, a - x)
		db = min(n - da, b - y)
		ans = min(ans, (a - da) * (b - db))
		(a, b) = (b, a)
		(x, y) = (y, x)
	print(ans)


import math
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if b < a:
		(a, b) = (b, a)
		(x, y) = (y, x)
	elif a == b:
		if x > y:
			(x, y) = (y, x)

	def lol(a, b, x, y, n):
		temp = min(a - x, n)
		a -= temp
		n -= temp
		temp = min(b - y, n)
		b -= temp
		return a * b
	print(min(lol(a, b, x, y, n), lol(b, a, y, x, n)))


def dio(a, b, x, y, n):
	(a1, b1) = (a, b)
	if a1 - n < x:
		a1 = x
	else:
		a1 -= n
	if b1 - n < y:
		b1 = y
	else:
		b1 -= n
	if a1 < b1:
		n -= a - x
		if n > 0:
			if b - n < y:
				b = y
			else:
				b -= n
		return b * a1
	else:
		n -= b - y
		if n > 0:
			if a - n >= x:
				a -= n
			else:
				a = x
		return a * b1
for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	print(dio(a, b, x, y, n))


t = int(input())
for i in range(t):
	(a, b, x, y, n) = map(int, input().split())
	if a - x + b - y <= n:
		print(x * y)
	elif max(a - n, x) < max(b - n, y):
		z = n - (a - x)
		if z >= 0:
			a = x
			b -= min(b - y, z)
			print(a * b)
		else:
			print((a - n) * b)
	else:
		z = n - (b - y)
		if z >= 0:
			b = y
			a -= min(a - x, z)
			print(a * b)
		else:
			print((b - n) * a)


for _ in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	if n >= a - x + b - y:
		print(x * y)
		continue
	flag = 0
	if a == b:
		if x < y:
			if n >= a - x:
				n -= a - x
				b = max(y, b - n)
				ans = x * b
				print(ans)
				flag = 1
				continue
			else:
				a -= n
				ans = a * b
				print(ans)
				flag = 1
				continue
		elif n >= b - y:
			n -= b - y
			a = max(x, a - n)
			ans = y * a
			print(ans)
			flag = 1
			continue
		else:
			b -= n
			ans = a * b
			print(ans)
			flag = 1
			continue
	if x < y:
		if n >= a - x:
			n -= a - x
			b = max(y, b - n)
			ans = x * b
			print(ans)
			flag = 1
			continue
	elif n >= b - y:
		n -= b - y
		a = max(x, a - n)
		ans = y * a
		print(ans)
		flag = 1
		continue
	p = max(a - n, x)
	q = max(y, abs(b - (n - (a - p))))
	one = p * q
	r = max(b - n, y)
	s = max(x, a - (n - (b - r)))
	if flag == 0:
		print(min(one, r * s))


def check1(a, b, x, y, n):
	hiku_ok = a - max(x, b)
	if hiku_ok >= n:
		a -= n
		n = 0
	if n > 0:
		if x < y:
			hiku_ok = a - x
			a -= min(hiku_ok, n)
			n -= min(hiku_ok, n)
			if n > 0:
				hiku_ok = b - y
				b -= min(hiku_ok, n)
				n -= min(hiku_ok, n)
		else:
			hiku_ok = b - y
			b -= min(hiku_ok, n)
			n -= min(hiku_ok, n)
			if n > 0:
				hiku_ok = a - x
				a -= min(hiku_ok, n)
				n -= min(hiku_ok, n)
	return a * b

def check2(a, b, x, y, n):
	hiku_ok = a - max(x, b)
	if hiku_ok >= n:
		a -= n
		n = 0
	if n > 0:
		if x >= y:
			hiku_ok = a - x
			a -= min(hiku_ok, n)
			n -= min(hiku_ok, n)
			if n > 0:
				hiku_ok = b - y
				b -= min(hiku_ok, n)
				n -= min(hiku_ok, n)
		else:
			hiku_ok = b - y
			b -= min(hiku_ok, n)
			n -= min(hiku_ok, n)
			if n > 0:
				hiku_ok = a - x
				a -= min(hiku_ok, n)
				n -= min(hiku_ok, n)
	return a * b

def check3(a, b, x, y, n):
	s = a - max(x, a - n)
	a -= s
	n -= s
	t = b - max(y, b - n)
	b -= t
	n -= t
	return a * b

def check4(b, a, y, x, n):
	s = a - max(x, a - n)
	a -= s
	n -= s
	t = b - max(y, b - n)
	b -= t
	n -= t
	return a * b

def main():
	T = int(input())
	for _ in range(T):
		(a, b, x, y, n) = (int(i) for i in input().split())
		if a < b:
			(a, b) = (b, a)
			(x, y) = (y, x)
		print(min(check1(a, b, x, y, n), check2(a, b, x, y, n), check3(a, b, x, y, n), check4(a, b, x, y, n)))
main()


def find(a, b, x, y, n):
	t = min(b - y, n)
	b -= min(b - y, n)
	n -= t
	if n > 0:
		if b > y:
			t = min(b - y, n)
			b -= t
			n -= t
		if a > x:
			t = min(a - x, n)
			a -= t
			n -= t
	return a * b
for ik in range(int(input())):
	(a, b, x, y, n) = map(int, input().split())
	ans = min(find(a, b, x, y, n), find(b, a, y, x, n))
	print(ans)


n = int(input())
for _ in range(n):
	(a, b, x, y, n) = tuple(map(int, input().split()))
	if b - y <= n:
		new_b = y
		new_a = max(x, a - n + b - y)
	else:
		new_b = b - n
		new_a = a
	if a - x <= n:
		new2_a = x
		new2_b = max(y, b - n + a - x)
	else:
		new2_a = a - n
		new2_b = b
	print(min(new_a * new_b, new2_a * new2_b))


from sys import stdin
for _ in range(int(stdin.readline())):
	(a, b, x, y, n) = list(map(int, stdin.readline().split()))
	min_a = max(x, a - n)
	min_b = max(y, b - n)
	if min_a < min_b:
		t = a - min_a
		a = min_a
		n -= t
		b = max(y, b - n)
	else:
		t = b - min_b
		b = min_b
		n -= t
		a = max(x, a - n)
	print(a * b)


import sys
stdin = sys.stdin
stdout = sys.stdout
test = int(stdin.readline())
for t in range(test):
	(a, b, x, y, n) = [int(_) for _ in stdin.readline().split()]
	p1 = min(n, a - x)
	p1_rem = min(n - p1, b - y)
	p2 = min(n, b - y)
	p2_rem = min(n - p2, a - x)
	ans = min((a - p1) * (b - p1_rem), (a - p2_rem) * (b - p2))
	stdout.write(f'{ans}\n')


t = int(input())
for _ in range(t):
	(a, b, x, y, n) = tuple([int(i) for i in input().split()])
	da = a - x
	db = b - y
	v = []
	if da > n:
		v.append(b * (a - n))
	else:
		v.append(x * max([b + da - n, y]))
	if db > n:
		v.append(a * (b - n))
	else:
		v.append(y * max([a + db - n, x]))
	print(min(v))