#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t, a, b, x, y, n, z, z2;
  cin >> t;
  while (t--) {
    cin >> a >> b >> x >> y >> n;
    if (abs(a - x) + abs(b - y) < n) {
      n = abs(a - x) + abs(b - y);
    }
    long long a2 = a, b2 = b, x2 = x, y2 = y, n2 = n;
    if (n2 > abs(a2 - x2)) {
      n2 -= abs(a2 - x2);
      a2 = x2;
      b2 -= n2;
    } else {
      a2 -= n2;
    }
    if (n > abs(b - y)) {
      n -= abs(b - y);
      b = y;
      a -= n;
    } else {
      b -= n;
    }
    cout << min(a2 * b2, a * b) << "\n";
  }
  return 0;
}
