#include <bits/stdc++.h>
using namespace std;
int n;
int arr[200007];
void TestingChaluKarEyy() {
  long long int a, b, x, y, n;
  long long int A, B;
  cin >> a >> b >> x >> y >> n;
  long long int ans = 1000000000000000007;
  A = a;
  B = b;
  {
    long long int aa = a - x;
    long long int bb = b - y;
    if (aa >= n) {
      A = a - n;
    } else {
      A = x;
      B = max(y, b - max((long long int)0, n - aa));
    }
    ans = min(ans, A * B);
  }
  A = a;
  B = b;
  {
    long long int aa = a - x;
    long long int bb = b - y;
    if (bb >= n) {
      B = b - n;
    } else {
      B = y;
      A = max(x, a - max((long long int)0, n - bb));
    }
    ans = min(ans, A * B);
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int TestingKaravvuChhe = 1;
  cin >> TestingKaravvuChhe;
  while (TestingKaravvuChhe--) {
    TestingChaluKarEyy();
  }
}
