#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long ta = a - min(a - x, n);
    long long tb = b - min(b - y, n);
    if (ta <= tb) {
      long long tmp = min(a - x, n);
      n -= tmp;
      a -= tmp;
      tmp = min(b - y, n);
      b -= tmp;
      cout << a * b << "\n";
    } else {
      long long tmp = min(b - y, n);
      n -= tmp;
      b -= tmp;
      tmp = min(a - x, n);
      a -= tmp;
      cout << a * b << "\n";
    }
  }
  return 0;
}
