#include <bits/stdc++.h>
int T;
long long a, b, x, y, n, res;
inline long long min(long long p, long long q) { return (p > q ? q : p); }
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld%lld", &a, &b, &x, &y, &n);
    long long dx, dy;
    dx = a - x;
    dy = b - y;
    if (dx + dy <= n)
      res = x * y;
    else {
      long long r1, r2;
      long long t1, t2;
      t1 = a - min(n, dx);
      if (n >= dx)
        r1 = t1 * (b - min(n - dx, dy));
      else
        r1 = t1 * b;
      t2 = b - min(n, dy);
      if (n >= dy)
        r2 = t2 * (a - min(n - dy, dx));
      else
        r2 = t2 * a;
      res = min(r1, r2);
    }
    printf("%lld\n", res);
  }
  return 0;
}
