#P1409B. Minimum Product

    ID: 5556 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>brute forcegreedymath*1100

Minimum Product

No submission language available for this problem.

Description

You are given four integers aa, bb, xx and yy. Initially, axa \ge x and byb \ge y. You can do the following operation no more than nn times:

  • Choose either aa or bb and decrease it by one. However, as a result of this operation, value of aa cannot become less than xx, and value of bb cannot become less than yy.

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

You have to answer tt independent test cases.

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

The only line of the test case contains five integers aa, bb, xx, yy and nn (1a,b,x,y,n1091 \le a, b, x, y, n \le 10^9). Additional constraint on the input: axa \ge x and byb \ge y always holds.

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

Input

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

The only line of the test case contains five integers aa, bb, xx, yy and nn (1a,b,x,y,n1091 \le a, b, x, y, n \le 10^9). Additional constraint on the input: axa \ge x and byb \ge y always holds.

Output

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

Samples

Sample Input 1

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

Sample Output 1

70
77
177177
999999999000000000
999999999
55
10

Note

In the first test case of the example, you need to decrease bb three times and obtain 107=7010 \cdot 7 = 70.

In the second test case of the example, you need to decrease aa one time, bb one time and obtain 117=7711 \cdot 7 = 77.

In the sixth test case of the example, you need to decrease aa five times and obtain 511=555 \cdot 11 = 55.

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