#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long mod = 1e9;
#pragma GCC optimize("-O2")
const long long INF = 10000000;
void flash() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(9);
}
void solve();
int32_t main() {
  flash();
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
void solve() {
  long long a, b, x, y, n;
  cin >> a >> b >> x >> y >> n;
  if (max(a - n, x) > max(b - n, y)) {
    swap(a, b);
    swap(x, y);
  }
  if (n > (a - x)) {
    n -= (a - x);
    a = x;
  } else {
    a -= n;
    n = 0;
  }
  if (n > (b - y)) {
    n -= (b - y);
    b = y;
  } else {
    b -= n;
    n = 0;
  }
  cout << a * b << "\n";
  return;
}
