#include <bits/stdc++.h>
using namespace std;
void solve() {
  unsigned long long a, b, x, y, n;
  cin >> a >> b >> x >> y >> n;
  unsigned long long ans = LLONG_MAX;
  for (unsigned long long i = 0; i < 2; ++i) {
    unsigned long long da = min(n, a - x);
    unsigned long long db = min(n - da, b - y);
    ans = min(ans, (a - da) * (b - db));
    swap(a, b);
    swap(x, y);
  }
  cout << ans << "\n";
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  unsigned long long test;
  cin >> test;
  while (test--) solve();
  return 0;
}
