#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t, n, m, xa, ya, xb, yb;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld%lld%lld%lld%lld%lld", &n, &m, &xa, &ya, &xb, &yb);
    long long miny = min(ya, yb), minx = min(xa, xb), maxy = max(ya, yb),
              maxx = max(xa, xb);
    long long s = (m - (maxy - miny)) * (n - (maxx - minx)) * 2;
    long long lx = n - (maxx - minx), ly = m - (maxy - miny);
    long long len1 = max(0ll, lx - (maxx - minx + 1) + 1),
              len2 = max(0ll, ly - (maxy - miny + 1) + 1);
    printf("%lld\n", max(0ll, n * m - (s - len1 * len2)));
  }
  return 0;
}
