#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimization("Ofast")
#pragma GCC optimization("unroll-loops")
#pragma GCC target("avx2,avx,fma")
const long long N = 200005;
int dir4[4][2] = {{1, 0}, {-1, 0}, {0, -1}, {0, 1}};
int dir8[8][2] = {{1, 0}, {-1, 0}, {0, -1}, {0, 1},
                  {1, 1}, {-1, 1}, {1, -1}, {-1, -1}};
long long power(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2)
    return (a * (power((a * a) % 1000000007, b / 2) % 1000000007)) % 1000000007;
  else
    return power((a * a) % 1000000007, b / 2) % 1000000007;
}
void solve() {}
long long fun(long long int a, long long int b, long long int x,
              long long int y, long long int n) {
  long long aa = a;
  a = max(a - n, x);
  long long int z = aa - a;
  n = n - z;
  if (n > 0) {
    b = max(b - n, y);
  }
  return a * b;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  cin >> t;
  double time1 = (double)clock() / CLOCKS_PER_SEC;
  while (t--) {
    long long int a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long ans = fun(a, b, x, y, n);
    swap(a, b);
    swap(x, y);
    cout << min(ans, fun(a, b, x, y, n)) << endl;
  }
  double time2 = (double)clock() / CLOCKS_PER_SEC;
  cerr << "time taken : " << time2 - time1 << " secs" << endl;
}
