#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const int mod = 1e9 + 7;
const int P = 1e9 + 7;
const int N = 2e7;
const int maxn = 1e6 + 5;
long long t, a, b, x, y, n, minn;
int main() {
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    cin >> a >> b >> x >> y >> n;
    long long temp1 = max(x, a - n);
    long long temp2 = max(y, b - n);
    if (temp1 >= temp2) {
      swap(a, b);
      swap(x, y);
    }
    minn = min(n, a - x);
    n -= minn;
    a -= minn;
    minn = min(n, b - y);
    b -= minn;
    cout << a * b << endl;
  }
}
