#include <bits/stdc++.h>
using namespace std;
long long expo(long long base, long long exponent, long long mod = 1000000007) {
  long long ans = 1;
  base %= mod;
  while (exponent != 0) {
    if (exponent & 1) ans = (1LL * ans * base) % mod;
    base = (1LL * base * base) % mod;
    exponent >>= 1;
  }
  return ans % mod;
}
long long inverse(long long x) { return expo(x, 1000000007 - 2, 1000000007); }
long long calculate(long long a, long long b, long long x, long long y,
                    long long n) {
  long long temp = min(n, a - x);
  a -= temp;
  n -= temp;
  b -= min(n, b - y);
  return a * b;
}
void solve() {
  long long a, b, x, y, n;
  cin >> a >> b >> x >> y >> n;
  cout << min(calculate(a, b, x, y, n), calculate(b, a, y, x, n)) << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
