#include <bits/stdc++.h>
using namespace std;
long long t, a, b, x, y, n;
long long slove1() {
  if (a < b) {
    if (a - n >= x) {
      a = a - n;
      n = 0;
    } else {
      n = n - (a - x);
      a = x;
      if (b - n >= y) {
        b = b - n;
        n = 0;
      } else {
        n = n - (b - y);
        b = y;
      }
    }
  }
  if (a >= b) {
    if (b - n >= y) {
      b = b - n;
      n = 0;
    } else {
      n = n - (b - y);
      b = y;
      if (a - n >= x) {
        a = a - n;
        n = 0;
      } else {
        n = n - (a - x);
        a = x;
      }
    }
  }
  return a * b;
}
long long slove2() {
  if (a >= b) {
    if (a - n >= x) {
      a = a - n;
      n = 0;
    } else {
      n = n - (a - x);
      a = x;
      if (b - n >= y) {
        b = b - n;
        n = 0;
      } else {
        n = n - (b - y);
        b = y;
      }
    }
  }
  if (a < b) {
    if (b - n >= y) {
      b = b - n;
      n = 0;
    } else {
      n = n - (b - y);
      b = y;
      if (a - n >= x) {
        a = a - n;
        n = 0;
      } else {
        n = n - (a - x);
        a = x;
      }
    }
  }
  return a * b;
}
long long minn(long long c, long long d) {
  if (c > d)
    return d;
  else
    return c;
}
int main() {
  cin >> t;
  while (t--) {
    long long ans1, ans2, i, j, p, q, r;
    cin >> a >> b >> x >> y >> n;
    i = a, j = b, p = x, q = y, r = n;
    ans1 = slove1();
    a = i, b = j, x = p, y = q, n = r;
    ans2 = slove2();
    cout << minn(ans1, ans2) << endl;
  }
}
