#include <bits/stdc++.h>
using namespace std;
long long i = 0, j = 0, k = 0, a, b, c, d, e, f, g, h, l, m, n, o, p, q, r, s,
          t = 1, u, v, w, x, y, z, maxx = INT_MIN, minn = INT_MAX, ans = 0,
          sum = 0, flag = 0, cnt = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> t;
  while (t--) {
    cin >> a >> b >> x >> y >> n;
    c = max(a - n, x);
    d = max(b - n, y);
    if (c < d) {
      if ((a - n) < x) {
        n = x - (a - n);
        d = max(b - n, y);
      } else
        d = b;
    } else {
      if ((b - n) < y) {
        n = y - (b - n);
        c = max(a - n, x);
      } else
        c = a;
    }
    cout << c * d << endl;
  }
  return 0;
}
