#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 5;
const int INF = 2e9;
const int MOD = 1e9 + 7;
void Solve() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    if ((a - x) + (b - y) <= n)
      cout << x * y;
    else {
      if ((a - x) <= n and (b - y) <= n) {
        if (x >= y) {
          cout << y * (a - (n - (b - y)));
        } else
          cout << x * (b - (n - (a - x)));
      } else if ((a - x) <= n) {
        if (x <= (b - n)) {
          cout << x * (b - (n - (a - x)));
        } else {
          cout << (b - n) * a;
        }
      } else if ((b - y) <= n) {
        if (y <= (a - n)) {
          cout << y * (a - (n - (b - y)));
        } else {
          cout << (a - n) * b;
        }
      } else {
        if ((a - n) <= (b - n)) {
          cout << (a - n) * b;
        } else {
          cout << (b - n) * a;
        }
      }
    }
    cout << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  Solve();
  return 0;
}
