#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
long long mmin(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long mmax(long long a, long long b) {
  if (a > b) return a;
  return b;
}
int main(void) {
  int t;
  cin >> t;
  while (t) {
    long long n, m, x, y, a, b;
    cin >> n >> m >> x >> y >> a >> b;
    long long rec1x = mmin(x, a) + n - mmax(x, a),
              rec1y = mmin(y, b) + m - mmax(y, b), rec2x = n - rec1x,
              rec2y = m - rec1y;
    long long ans = n * m - (rec1x) * (rec1y)*2;
    long long sub = (rec1x - rec2x) * (rec1y - rec2y);
    if (rec1x - rec2x < 0 || rec1y - rec2y < 0) sub = 0;
    cout << ans + sub << endl;
    t--;
  }
  return 0;
}
