#include <bits/stdc++.h>
const int N = 1000010;
const int MOD = 1e9 + 7;
using namespace std;
long long int t, a, b, x, y, n;
int main() {
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    long long int ans = 0;
    scanf("%d %d", &a, &b);
    scanf("%d %d", &x, &y);
    scanf("%d", &n);
    if (n > a + b - x - y) {
      ans = x * y;
      printf("%lld\n", ans);
    } else if (a == b) {
      if (x <= y) {
        if (a - x >= n) {
          ans = (a - n) * b;
          printf("%lld\n", ans);
        } else {
          ans = (a + b - n - x) * x;
          printf("%lld\n", ans);
        }
      } else if (x > y) {
        if (b - y >= n) {
          ans = (b - n) * a;
          printf("%lld\n", ans);
        } else {
          ans = (a + b - n - y) * y;
          printf("%lld\n", ans);
        }
      }
    } else if (a < b) {
      if (a - x >= n)
        ans = (a - n) * b;
      else {
        ans = (a + b - n - x) * x;
        long long int m;
        if (b - y >= n)
          m = (b - n) * a;
        else
          m = (a + b - n - y) * y;
        ans = min(ans, m);
      }
      printf("%lld\n", ans);
    } else {
      if (b - y >= n)
        ans = (b - n) * a;
      else {
        ans = (a + b - n - y) * y;
        long long int m;
        if (a - x >= n)
          m = (a - n) * b;
        else
          m = (a + b - n - x) * x;
        ans = min(ans, m);
      }
      printf("%lld\n", ans);
    }
  }
  return 0;
}
