#include <bits/stdc++.h>
using namespace std;
int n, m;
struct Point {
  long long x, y;
  Point(long long _x, long long _y) : x(_x), y(_y) {}
};
int main() {
  int T;
  long long x1, y1, x2, y2;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &m);
    scanf("%I64d%I64d%I64d%I64d", &x1, &y1, &x2, &y2);
    Point p = Point(x1, y1);
    Point q = Point(x2, y2);
    if (p.x > q.x) swap(p, q);
    if (p.y > q.y) {
      swap(p.x, p.y);
      p.x = m + 1 - p.x;
      swap(q.x, q.y);
      q.x = m + 1 - q.x;
      swap(n, m);
    }
    x1 = n - (q.x - p.x);
    y1 = m - (q.y - p.y);
    long long ans = 1LL * n * m;
    ans -= 2LL * x1 * y1;
    x2 = (q.x - p.x) + 1LL;
    y2 = (q.y - p.y) + 1LL;
    if (x2 <= x1 && y2 <= y1) {
      ans += (x1 - x2 + 1LL) * (y1 - y2 + 1LL);
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
