#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long double pi = acos((long double)-1);
const long double e = exp(1);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b;
    cin >> a >> b;
    long long x, y;
    cin >> x >> y;
    long long n;
    cin >> n;
    long long a2 = a, b2 = b, n2 = n;
    long long ans1, ans2;
    long long e = min(a - x, n);
    a -= e;
    n -= e;
    b -= min(b - y, n);
    ans1 = a * b;
    long long f = min(b2 - y, n2);
    b2 -= f;
    n2 -= f;
    a2 -= min(a2 - x, n2);
    ans2 = a2 * b2;
    cout << min(ans1, ans2) << "\n";
  }
}
