#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long a1 = a - x;
    long long b1 = b - y;
    long long a2 = a;
    long long b2 = b;
    long long nn = n;
    if (a1 >= nn)
      a2 -= nn;
    else {
      nn -= a1;
      a2 -= a1;
      if (b1 >= nn)
        b2 -= nn;
      else
        b2 -= b1;
    }
    long long ans1 = a2 * b2;
    long long a3 = a;
    long long b3 = b;
    if (b1 >= n)
      b3 -= n;
    else {
      n -= b1;
      b3 -= b1;
      if (a1 >= n)
        a3 -= n;
      else
        a3 -= a1;
    }
    long long ans2 = a3 * b3;
    long long ans = min(ans1, ans2);
    cout << ans << endl;
  }
}
