#include <bits/stdc++.h>
using namespace std;
long long int i, j, k, t, n, a, b, c, x, y, z;
int main() {
  cin >> t;
  while (t--) {
    cin >> a >> b >> x >> y >> n;
    long long int p = min(a - x, n);
    long long int q = min(b - y, n);
    long long int ans1 = 0, ans2 = 0;
    long long int a1, b1, a2, b2, n1, n2;
    a1 = a - p;
    n1 = n - p;
    if (n1 > 0) {
      p = min(b - y, n1);
      b1 = b - p;
    } else {
      b1 = b;
    }
    b2 = b - q;
    n2 = n - q;
    if (n2 > 0) {
      q = min(a - x, n2);
      a2 = a - q;
    } else {
      a2 = a;
    }
    cout << min(a1 * b1, a2 * b2) << '\n';
  }
  return 0;
}
