#include <bits/stdc++.h>
using namespace std;
long long int min_prod(int a, int b, int x, int y, int n) {
  long long int prod;
  if ((a - n) >= x) {
    prod = (a - n) * 1ll * b;
  } else {
    if ((b - n + a - x) >= y)
      prod = x * 1ll * (b - n + a - x);
    else
      prod = x * 1ll * y;
  }
  return prod;
}
int main() {
  int t, a, b, x, y, n;
  int i, p, q;
  cin >> t;
  for (i = 0; i < t; i++) {
    cin >> a >> b >> x >> y >> n;
    p = a - n;
    q = b - n;
    if (p < x) p = x;
    if (q < y) q = y;
    if (p < q)
      cout << min_prod(a, b, x, y, n) << endl;
    else
      cout << min_prod(b, a, y, x, n) << endl;
  }
  return 0;
}
