#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, x, y, n;
  cin >> a >> b >> x >> y >> n;
  long long ans = 1e18;
  {
    long long t = min(a - x, n);
    ans = (a - t) * (b - min(b - y, n - t));
  }
  {
    long long t = min(b - y, n);
    ans = min(ans, (b - t) * (a - min(a - x, n - t)));
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
