#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, x, y, n, pro, pro1;
    cin >> a >> b >> x >> y >> n;
    if (n <= a - x)
      pro = (a - n) * b;
    else if ((b - (n - (a - x))) >= y) {
      pro = (x) * (b - (n - (a - x)));
    } else
      pro = x * y;
    if (n < b - y)
      pro1 = (b - n) * a;
    else if ((a - (n - (b - y)) >= x)) {
      pro1 = (y) * (a - (n - (b - y)));
    } else
      pro1 = x * y;
    if (pro < pro1)
      cout << pro << endl;
    else
      cout << pro1 << endl;
  }
  return 0;
}
