#include <bits/stdc++.h>
using namespace std;
const int oo = int(1e9);
const int64_t lloo = (int64_t)(1e18);
class Task {
 public:
  int64_t a, b, x, y, n;
  void solveOne(istream &in, ostream &out) {
    in >> a >> b >> x >> y >> n;
    int64_t diffa = abs(a - x);
    int64_t diffb = abs(b - y);
    int64_t mn = min(a * x, b * y);
    int64_t aa = a, bb = b, nn = n;
    bool ok0 = 0;
    if (diffa <= n) {
      a -= diffa;
      n -= diffa;
    } else {
      a -= n;
      n = 0;
      ok0 = 1;
    }
    if (!ok0) {
      if (diffb <= n) {
        b -= diffb;
        n -= diffb;
      } else {
        b -= n;
        n = 0;
      }
    }
    bool ok = 0;
    if (diffb <= nn) {
      bb -= diffb;
      nn -= diffb;
    } else {
      bb -= nn;
      nn = 0;
      ok = 1;
    }
    if (!ok) {
      if (diffa <= nn) {
        aa -= diffa;
        nn -= diffa;
      } else {
        aa -= nn;
        nn = 0;
      }
    }
    int64_t ans1 = a * b;
    int64_t ans2 = aa * bb;
    out << min(ans1, ans2) << '\n';
  }
  void solve(istream &in, ostream &out) {
    int t = 1;
    in >> t;
    while (t--) solveOne(in, out);
  }
};
auto main() -> int {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Task solver;
  istream &in(cin);
  ostream &out(cout);
  solver.solve(in, out);
  return 0;
}
