#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int t;
  cin >> t;
  while (t--) {
    long long a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long am = a - x;
    long long bm = b - y;
    long long moved;
    long long temp = n;
    long long best = 1e18;
    long long at = a, bt = b;
    moved = min(am, n);
    at -= moved;
    n -= moved;
    moved = min(bm, n);
    bt -= moved;
    n -= moved;
    best = min(at * bt, best);
    at = a, bt = b, n = temp;
    moved = min(bm, n);
    bt -= moved;
    n -= moved;
    moved = min(am, n);
    at -= moved;
    n -= moved;
    best = min(at * bt, best);
    cout << best << endl;
  }
}
