#include <bits/stdc++.h>
using namespace std;
long long ceil(long long n, long long d) { return ((n / d) + (n % d) != 0); }
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    string str;
    long long A, B, X, Y, N;
    cin >> A >> B >> X >> Y >> N;
    long long ans1, ans2;
    {
      long long a = A, b = B;
      long long x = X, y = Y;
      long long n = N;
      if (a - n >= x) {
        a -= n;
        n = 0;
      } else {
        n -= (a - x);
        a = x;
      }
      if (b - n >= y) {
        b -= n;
        n = 0;
      } else {
        n -= (b - y);
        b = y;
      }
      ans1 = a * b;
    }
    {
      long long a = B, b = A;
      long long x = Y, y = X;
      long long n = N;
      if (a - n >= x) {
        a -= n;
        n = 0;
      } else {
        n -= (a - x);
        a = x;
      }
      if (b - n >= y) {
        b -= n;
        n = 0;
      } else {
        n -= (b - y);
        b = y;
      }
      ans2 = a * b;
    }
    cout << min(ans1, ans2) << endl;
  }
  return 0;
}
