#include <bits/stdc++.h>
using namespace std;
long long n, m, a[210101], asdaf, k, asdasd, ans, mx, b[210001];
map<long long, long long> us;
vector<long long> v;
int main() {
  long long t24 = 1;
  cin >> t24;
  for (long long qwe = 1; qwe <= t24; qwe++) {
    long long sum = 0, q1 = 0, l = 0, kol = 0, q = 1e9, kol1 = 0;
    long long a, b;
    cin >> a >> b >> asdasd >> asdaf >> n;
    if ((a - asdasd) + (b - asdaf) <= n) {
      cout << asdasd * asdaf << '\n';
      continue;
    }
    cout << min((max(a - n, asdasd) *
                 max(b - max(n - max(a - asdasd, 0ll), 0ll), asdaf)),
                (max(b - n, asdaf) *
                 max(a - max(n - max(b - asdaf, 0ll), 0ll), asdasd)))
         << endl;
  }
  return 0;
}
