#include <bits/stdc++.h>
using namespace std;
template <class T>
T toDec(string s) {
  stringstream is(s);
  T res;
  is >> res;
  return res;
}
template <class T>
string toStr(T n) {
  string s;
  stringstream is;
  is << n;
  is >> s;
  return s;
}
template <class T>
bool isPrime(T x) {
  if (x <= 1) return false;
  T i;
  for (i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
template <class T>
double dist(T x1, T y1, T x2, T y2) {
  return sqrt(1. * (x2 - x1) * (x2 - x1) + 1. * (y2 - y1) * (y2 - y1));
}
int main() {
  long long n, m, fi, t, fj, si, sj, res, f, s, x1, r, c;
  cin >> t;
  while (t--) {
    cin >> n >> m >> fj >> fi >> sj >> si;
    x1 = min(fi, si);
    fi -= x1 - 1;
    si -= x1 - 1;
    x1 = min(fj, sj);
    fj -= x1 - 1;
    sj -= x1 - 1;
    f = max(fi, si);
    s = max(fj, sj);
    r = (m - f + 1);
    c = (n - s + 1);
    res = r * c * 2;
    if (f <= r && s <= c) res -= (r - f + 1) * (c - s + 1);
    cout << n * m - res << "\n";
  }
  return 0;
}
