#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("popcnt")
#pragma GCC optimize("-Ofast")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
using namespace std;
template <typename T>
T read() {
  T a = 0;
  char b = 1, c;
  do
    if ((c = getchar()) == 45) b = -1;
  while (c < 48 || c > 57);
  do a = (a << 3) + (a << 1) + (c & 15);
  while ((c = getchar()) > 47 && c < 58);
  return a * b;
}
template <typename T>
void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  char a[10], s = 0;
  do a[s++] = x % 10 | 48;
  while (x /= 10);
  do putchar(a[--s]);
  while (s);
}
template <typename... T>
void input(T &...args) {
  ((args = read<T>()), ...);
}
template <typename... T>
void output(T &&...args) {
  ((write<T>(args), putchar(' ')), ...);
}
void ReadTests();
void CinTests();
void solution() {
  long long a, b, x, y, n;
  cin >> a >> b >> x >> y >> n;
  long long left_most = max(a - n, x);
  long long right_most = max(b - n, y);
  long long l, u, p, q;
  if (left_most < right_most) {
    l = a;
    p = x;
    u = b;
    q = y;
  } else {
    l = b;
    p = y;
    u = a;
    q = x;
  };
  long long most = l - p;
  l -= min(most, n);
  n -= min(most, n);
  most = u - q;
  u -= min(n, most);
  cout << l * u;
}
signed main() {
  short _READ_ = 2;
  if (_READ_ == 1)
    solution();
  else if (_READ_ == 2)
    ReadTests();
  else if (_READ_ == 3)
    CinTests();
  else
    cerr << "INVALID TESTS!\n";
  return 0;
}
void ReadTests() {
  long long T = read<long long>();
  while (T--) {
    solution();
    putchar('\n');
  }
}
void CinTests() {
  long long T;
  cin >> T;
  while (T--) {
    solution();
    cout << '\n';
    ;
  }
}
