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

Starter code:

Solutions:
t = int(input())
# a = list(map(int, input().split()))
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 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))



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


def solve(a, b, x, y, n):
    x = a-x
    y = b-y
    m = min(x, n)
    n -= m
    a -= m
    m = min(y, n)
    b -= m
    return a*b
    
for _ in range(int(input())):
    a, b, x, y, n = list(map(int, input().split()))
    print(min(solve(a, b, x, y, n), solve(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)


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)


#Bhargey Mehta (Senior)
#DA-IICT, Gandhinagar
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):
    #print("Case #{}: ".format(test), end="")
    solve(test)


"""T=int(input())
for _ in range(0,T):
    n=int(input())
    a,b=map(int,input().split())
    s=input()
    s=[int(x) for x in input().split()]
    for i in range(0,len(s)):
        a,b=map(int,input().split())"""


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
    #print(a,b)
    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

    
    #print(A,B)
    ans=min(ans,A*B)
    print(ans)


    
    


import sys


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


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


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)


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)

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

import sys, math
import io, os
#data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
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
# from itertools import permutations,combinations
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
# from fractions import Fraction
# sys.setrecursionlimit(100000)
mod = int(1e9) + 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)

# Fast IO (be careful about bytestring)

# import os,io
# input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline


for _ in range(int(input())):
    a,b,x,y,n = list(map(int,input().split()))
    if a + b - x - y < n:
        print(x * y)
    else:
        minProduct = 10 ** 20
        # Decreasing a first
        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
        # Decreasing b first
        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)


for _ in range(int(input())):
    a,b,x,y,n=list(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)



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


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):
    # n = int(input())
    a, b, x, y, n = map(int, input().split())
    # a = list(map(int, input().split()))
    print(min(solve(a, b, x, y, n), solve(b, a, y, x, n)))

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

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

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


	


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

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)


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

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
    
    #first a
    if a-x >= n:
        ans = min(ans , (a-n) * b)
    else:
        rem = n - (a-x)
        ans = min(ans , x * (b-rem))

    #b
    if b-y >= n:
        ans = min(ans , (b-n) * a)
    else:
        rem = n - (b-y)
        ans = min(ans , y * (a-rem))

    print (ans)