#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, x, y, n, ans, t;
  cin >> t;
  while (t--) {
    ans = LLONG_MAX;
    cin >> a >> b >> x >> y >> n;
    if (n >= (a - x + b - y))
      cout << x * y << "\n";
    else {
      if ((a - n) >= x)
        ans = (a - n) * b;
      else {
        if (b - (x - a + n) >= y) ans = min(ans, x * (b - (x - a + n)));
      }
      if ((b - n) >= y)
        ans = min(ans, (b - n) * a);
      else {
        if (a - (y - b + n) >= x) ans = min(ans, y * (a - (y - b + n)));
      }
      cout << ans << "\n";
    }
  }
}
