#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 m1 = min(a - x, n), m2 = min(b - y, n), a1 = a, b1 = b, n1 = n;
    a -= m1;
    n -= m1;
    b -= min(n, b - y);
    b1 -= m2;
    n1 -= m2;
    a1 -= min(n1, a1 - x);
    cout << min(a * b, a1 * b1) << endl;
  }
  return 0;
}
