#include <bits/stdc++.h>
using namespace std;
int t;
long long f(long long a, long long b, long long x, long long y, long long n) {
  long long tmp1 = a - x;
  if (tmp1 >= n) {
    a -= n;
    return a * b;
  }
  a = x;
  n -= tmp1;
  long long tmp2 = b - y;
  if (tmp2 >= n) {
    b -= n;
    return a * b;
  }
  return x * y;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    long long a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long ans1 = 1, ans2 = 0;
    ans1 = f(a, b, x, y, n);
    ans2 = f(b, a, y, x, n);
    cout << min(ans1, ans2) << endl;
  }
}
