#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;
    long long a1 = a, b1 = b, n1 = n;
    long long an = a - x, bn = b - y;
    b -= min(bn, n);
    n -= min(bn, n);
    a -= min(an, n);
    a1 -= min(an, n1);
    n1 -= min(an, n1);
    b1 -= min(bn, n1);
    cout << min(a1 * b1, a * b) << "\n";
  }
}
