#include <bits/stdc++.h>
using namespace std;
long long variant1(long long a, long long b, long long x, long long y,
                   long long n) {
  long long bonus_a, bonus_b;
  if (n % 2 == 0)
    bonus_a = bonus_b = n / 2;
  else
    bonus_a = n / 2, bonus_b = n / 2 + 1;
  long long can_a = a - x;
  long long can_b = b - y;
  long long copy_y = y;
  x += max(can_a - bonus_a, 0LL);
  y += max(can_b - bonus_b, 0LL);
  y -= max(0LL, bonus_a - can_a);
  y = max(y, copy_y);
  return x * y;
}
long long variant2(long long a, long long b, long long x, long long y,
                   long long n) {
  long long can_a = a - x;
  long long can_b = b - y;
  x += max(0LL, can_a - n);
  n = max(0LL, n - can_a);
  long long copy_y = y;
  y += max(0LL, can_b - n);
  return x * y;
}
long long variant3(long long a, long long b, long long x, long long y,
                   long long n) {
  long long can_a = a - x;
  long long can_b = b - y;
  y += max(0LL, can_b - n);
  n = max(0LL, n - can_b);
  x += max(0LL, can_a - n);
  return x * y;
}
void solve() {
  long long a, b, x, y, n;
  cin >> a >> b >> x >> y >> n;
  long long ans1 = variant1(a, b, x, y, n);
  long long ans2 = variant2(a, b, x, y, n);
  long long ans3 = variant3(a, b, x, y, n);
  cout << min(ans1, min(ans2, ans3)) << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
