#include <bits/stdc++.h>
using namespace std;
const long long int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const long long int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
long long int power(long long int a, long long int b,
                    long long int m = 1000000007) {
  long long int ans = 1;
  a = a % m;
  while (b > 0) {
    if (b & 1) ans = (1LL * a * ans) % m;
    b >>= 1;
    a = (1LL * a * a) % m;
  }
  return ans;
}
long long int ncr(long long int n, long long int r) {
  long long int res = 1;
  if (r > n - r) r = n - r;
  for (long long int i = 0; i < r; i++) {
    res *= n - i;
    res /= i + 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
clock_t time_p = clock();
void rtime() {
  time_p = clock() - time_p;
  cerr << "******************\nTime taken : "
       << (long double)(time_p) / CLOCKS_PER_SEC << "\n";
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int tt = 1;
  cin >> tt;
  long long int ii = 0;
  while (tt-- && ++ii) {
    long long int a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long int ans = a * b;
    long long int aa = max(a - n, x);
    long long int rem = n - (a - aa);
    long long int bb = max(b - rem, y);
    ans = min(ans, aa * bb);
    bb = max(b - n, y);
    rem = n - (b - bb);
    aa = max(a - rem, x);
    ans = min(ans, aa * bb);
    cout << ans << "\n";
  }
  return 0;
}
