#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    int dx = a - x, dy = b - y;
    int aa = a, bb = b, nn = n;
    aa -= min(dx, nn);
    nn -= min(dx, nn);
    if (nn) {
      bb -= min(dy, nn);
      nn -= min(dy, nn);
    }
    long long ans1 = 1LL * aa * bb;
    aa = a, bb = b, nn = n;
    bb -= min(dy, nn);
    nn -= min(dy, nn);
    if (nn) {
      aa -= min(dx, nn);
      nn -= min(dx, nn);
    }
    long long ans2 = 1LL * aa * bb;
    cout << min(ans1, ans2) << "\n";
  }
}
