#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, x, y, n;
  cin >> a >> b >> x >> y >> n;
  if (a - min(a - x, n) >= b - min(b - y, n)) {
    swap(a, b);
    swap(x, y);
  }
  long long d1 = a - x;
  long long d2 = b - y;
  long long res1 = min(a - x, n);
  n -= res1;
  long long res2 = min(b - y, n);
  long long ans = (a - res1) * (b - res2);
  cout << ans;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << endl;
  }
}
