#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, n, m, c, t, cs = 1;
  cin >> t;
  while (t--) {
    long long a, b, x, y;
    scanf("%lld %lld %lld %lld %lld", &a, &b, &x, &y, &n);
    long long aa = a, bb = b, nn = n;
    long long c = min(a - x, n);
    n -= c;
    a -= c;
    c = min(b - y, n);
    n -= c;
    b -= c;
    long long ans = a * b;
    c = min(bb - y, nn);
    nn -= c;
    bb -= c;
    c = min(aa - x, nn);
    nn -= c;
    aa -= c;
    ans = min(ans, aa * bb);
    printf("%lld\n", ans);
  }
}
