#include <bits/stdc++.h>
using namespace std;
void fun() {
  long long a, b, x, y, n, s, d, i, j;
  long long aa, bb, xx, yy, nn;
  vector<long long> vec;
  cin >> a >> b >> x >> y >> n;
  aa = a;
  bb = b;
  xx = x;
  yy = y;
  nn = n;
  long long p;
  p = a;
  a = b;
  b = p;
  p = x;
  x = y;
  y = p;
  {
    long long col = b - y;
    if (col > n) {
      b -= n;
      n = 0;
    } else {
      n -= col;
      b = y;
    }
    col = a - x;
    if (col > n) {
      a -= n;
    } else
      a = x;
  }
  {
    long long col = bb - yy;
    if (col > nn) {
      bb -= nn;
      nn = 0;
    } else {
      nn -= col;
      bb = yy;
    }
    col = aa - xx;
    if (col > nn) {
      aa -= nn;
    } else
      aa = xx;
  }
  cout << min(a * b, aa * bb) << endl;
}
int main() {
  long long a, i, j, s, d;
  cin >> a;
  for (i = 0; i < a; i++) {
    fun();
  }
}
