#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long n, m, x1, y1, x2, y2;
    long long minx, miny, maxx, maxy, up, left, right, down;
    long long lenleft, lenright, lenup, lendown, deltax = 0, deltay = 0;
    long long ans = 0;
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    minx = min(x1, x2);
    miny = min(y1, y2);
    maxx = max(x1, x2);
    maxy = max(y1, y2);
    up = minx - 1;
    left = miny - 1;
    down = n - maxx;
    right = m - maxy;
    lendown = minx + down;
    lenleft = miny + right;
    lenup = maxx - up;
    lenright = maxy - left;
    if (lendown >= lenup) {
      deltax = lendown - lenup + 1;
    }
    if (lenleft >= lenright) {
      deltay = lenleft - lenright + 1;
    }
    ans = lendown * lenleft + (n - lenup + 1) * (m - lenright + 1);
    if (deltax > 0 && deltay > 0) {
      ans -= deltax * deltay;
    }
    cout << n * m - ans << endl;
  }
  return 0;
}
