#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T{};
  cin >> T;
  for (int t = 0; t < T; t++) {
    int a{}, b{}, x{}, y{}, n{};
    cin >> a >> b >> x >> y >> n;
    vector<unsigned long long int> vec{};
    int q = a - x;
    int m = b - y;
    if (q >= n) {
      unsigned long long int temp = a - n;
      temp = temp * b;
      vec.emplace_back(temp);
    }
    if (m >= n) {
      unsigned long long int temp = b - n;
      temp *= a;
      vec.emplace_back(temp);
    }
    if (q < n) {
      unsigned long long int tempq = a - q;
      unsigned long long int tempn = n - q;
      unsigned long long int tempm{};
      if (tempn <= m)
        tempm = b - tempn;
      else
        tempm = y;
      unsigned long long int temp = tempm * tempq;
      vec.emplace_back(temp);
    }
    if (m < n) {
      unsigned long long int tempm = b - m;
      unsigned long long int tempn = n - m;
      unsigned long long int tempq{};
      if (tempn <= q)
        tempq = a - tempn;
      else
        tempq = x;
      unsigned long long int temp = tempq * tempm;
      vec.emplace_back(temp);
    }
    sort(vec.begin(), vec.end());
    cout << vec[0] << endl;
  }
  return 0;
}
