#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, i, j;
  cin >> t;
  while (t--) {
    long long a, b, x, y;
    cin >> a >> b >> x >> y >> n;
    long long p = a, q = b, r = n;
    if (a >= x) {
      if (a - x >= n) {
        a = a - n;
        n = 0;
      } else {
        n = n - (a - x);
        a = x;
      }
    }
    if (b >= y) {
      if (b - y >= n) {
        b = b - n;
        n = 0;
      } else {
        n = n - (b - y);
        b = y;
      }
    }
    long long z = a * b;
    a = p;
    b = q;
    n = r;
    if (b >= y) {
      if (b - y >= n) {
        b = b - n;
        n = 0;
      } else {
        n = n - (b - y);
        b = y;
      }
    }
    if (a >= x) {
      if (a - x >= n) {
        a = a - n;
        n = 0;
      } else {
        n = n - (a - x);
        a = x;
      }
    }
    z = min(z, a * b);
    cout << z << endl;
  }
}
