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