#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    int tc = 2;
    long long ans = 1e18;
    while (tc--) {
      int a1 = min(n, a - x);
      int b1 = min(n - a1, b - y);
      ans = min(ans, (a - a1) * (b - b1));
      swap(a, b);
      swap(x, y);
    }
    cout << ans << "\n";
  }
  return 0;
}
