#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, x, y, n, ma, mb;
    cin >> a >> b >> x >> y >> n;
    (a - n) < x ? ma = x : ma = a - n;
    (b - n) < y ? mb = y : mb = b - n;
    if (mb < ma) {
      b = b - n;
      long long rem = 0;
      if (b < y) {
        rem = y - b;
        b = y;
      }
      a = a - rem;
      if (a < x) {
        a = x;
      }
    } else {
      a = a - n;
      long long rem = 0;
      if (a < x) {
        rem = x - a;
        a = x;
      }
      b = b - rem;
      if (b < y) {
        b = y;
      }
    }
    cout << a * b << endl;
  }
}
