#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, x, y, n;
  cin >> a >> b >> x >> y >> n;
  long long op1a = a, op1b = b;
  op1a -= min(a - x, n);
  if (n > a - x) {
    long long remain = n - (a - x);
    op1b -= min(b - y, remain);
  }
  long long ans1 = op1a * op1b;
  long long op2a = a, op2b = b;
  op2b -= min(b - y, n);
  if (n > b - y) {
    long long remain = n - (b - y);
    op2a -= min(a - x, remain);
  }
  long long ans2 = op2a * op2b;
  cout << min(ans1, ans2) << endl;
  return;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    solve();
  }
}
