#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  for (int i = 0; i < tc; i++) {
    long long int a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long count = 0, count1 = 0;
    long long int k = n, u, v;
    long long int p = a - x;
    if (n >= p) {
      u = x;
      k = k - p;
      long long int m = b - y;
      if (k >= m) {
        v = y;
      } else {
        v = b - k;
      }
      count = u * v;
    } else {
      u = a - n;
      count = u * b;
    }
    p = b - y;
    if (n >= p) {
      b = y;
      n = n - p;
      long long int m = a - x;
      if (n >= m) {
        a = x;
      } else {
        a = a - n;
      }
      count1 = a * b;
    } else {
      b = b - n;
      count1 = a * b;
    }
    cout << min(count, count1) << endl;
  }
}
