#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    int a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    int m, e, o, p;
    m = a - min(n, (a - x));
    e = b - min(n - min(n, (a - x)), (b - y));
    o = b - min(n, (b - y));
    p = a - min(n - min(n, (b - y)), (a - x));
    cout << min(m * 1ll * e, o * 1ll * p) << endl;
  }
}
