#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535897932384626;
const long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long int c = a, d = b, m = n;
    long long int p = min(a - x, n);
    n = n - p;
    a = a - p;
    p = min(b - y, n);
    b -= p;
    p = min(d - y, m);
    m = m - p;
    d = d - p;
    p = min(c - x, m);
    c -= p;
    cout << min(a * b, c * d) << "\n";
  }
  return 0;
}
