#include <bits/stdc++.h>
using namespace std;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fastio();
  int t;
  cin >> t;
  while (t--) {
    int a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    int fma = max(a - n, x), fmb = max(b - n, y);
    long long int res;
    if (fma > fmb) {
      n -= b - fmb;
      fma = max(a - n, x);
    } else {
      n -= a - fma;
      fmb = max(b - n, y);
    }
    res = fma * 1LL * fmb;
    cout << res << "\n";
  }
  return 0;
}
