#include <bits/stdc++.h>
using namespace std;
long long a, b, x, y, n;
void bhak() {
  cin >> a >> b >> x >> y >> n;
  long long tempa = a;
  long long tempb = b;
  long long tempn = n;
  if (a - x <= tempn) {
    tempa = x;
    tempn -= (a - x);
  } else {
    tempa = a - tempn;
    tempn = 0;
  }
  if (b - y <= tempn) {
    tempb = y;
    tempn -= (b - y);
  } else {
    tempb = b - tempn;
    tempn = 0;
  }
  long long ans = (tempa * tempb);
  tempa = a;
  tempb = b;
  tempn = n;
  if (b - y <= tempn) {
    tempb = y;
    tempn -= (b - y);
  } else {
    tempb = b - tempn;
    tempn = 0;
  }
  if (a - x <= tempn) {
    tempa = x;
    tempn -= (a - x);
  } else {
    tempa = a - tempn;
    tempn = 0;
  }
  ans = min(tempa * tempb, ans);
  cout << ans << endl;
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    bhak();
  }
}
