#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  long long a, _a, b, _b, x, y, n, _n, check;
  cin >> t;
  while (t--) {
    cin >> a >> b >> x >> y >> n;
    _a = a, _b = b, _n = n;
    check = min(n, a - x);
    n -= check, a -= check;
    check = min(n, b - y);
    n -= check, b -= check;
    check = min(_n, _b - y);
    _n -= check, _b -= check;
    check = min(_n, _a - x);
    _n -= check, _a -= check;
    cout << min(a * b, _a * _b) << '\n';
  }
  return 0;
}
