#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
const int Max = 200010;
long long MIN(long long x, long long y) {
  if (x > y) {
    return y;
  } else {
    return x;
  }
}
long long MAX(long long x, long long y) {
  if (y > x) {
    return y;
  } else {
    return x;
  }
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long power(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
long long lol_test(long long a, long long b, long long c, long long d,
                   long long e) {
  long long x = MIN(a - c, e);
  a = a - x;
  e = e - x;
  if (e != 0) {
    b = b - MIN(e, b - d);
  }
  return a * b;
}
int main() {
  int t = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(8);
  cout << fixed;
  cin >> t;
  while (t--) {
    long long i = 0, j = 0, k = 0, n = 0, m = 0, x = 0, y = 0, sum = 0, res = 0,
              p = 0, q = 0, l = 0, r = 0, d = 0, a = 0, c = 0, b = 0, count = 0,
              max = 0, z = 0;
    double ans = 0, a1, b1;
    string s1, s2, s3 = "";
    set<long long> ss, se;
    vector<long long> v1, v2, v3, v4;
    int pmin = 1001, cmin = 1001;
    bool flag;
    map<long long, long long> mp1, mp2;
    char ch;
    cin >> a >> b >> p >> q >> d;
    cout << MIN(lol_test(a, b, p, q, d), lol_test(b, a, q, p, d)) << "\n";
  }
  return 0;
}
