#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  for (long long int test = 1; test <= t; test++) {
    long long int a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    long long int bb, aa, aaa, bbb, num = n;
    bb = max(y, b - n);
    n = n - (b - bb);
    aa = max(x, a - n);
    aaa = max(x, a - num);
    num = num - (a - aaa);
    bbb = max(y, b - num);
    cout << min(bb * aa, bbb * aaa) << "\n";
  }
  return 0;
}
