#include <bits/stdc++.h>
using namespace std;
const long long UNO = 1LL;
const long long DOS = 2LL;
const long long CERO = 0LL;
long long fun(pair<long long, long long> p1, pair<long long, long long> p2,
              pair<long long, long long> p3, pair<long long, long long> p4) {
  long long a = CERO, b = CERO;
  if (p2.first >= p3.first) {
    a = p2.first - p3.first + UNO;
  }
  if (p2.second >= p3.second && p2.second <= p4.second) {
    b = p2.second - p3.second + UNO;
  } else {
    if (p1.second >= p3.second && p1.second <= p4.second) {
      b = p4.second - p1.second + UNO;
    }
  }
  return a * b;
}
int main() {
  int t;
  scanf("%d", &t);
  for (int caso = (0); caso < (t); ++caso) {
    long long n, m, x1, y1, x2, y2;
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    long long r = n * m, inter, a, b, c, d;
    if (x1 > x2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    a = x1 - UNO;
    b = n - x2;
    if (y1 > y2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    c = y1 - UNO;
    d = m - y2;
    if (x1 > x2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    pair<long long, long long> p1(x1 - a, y1 - c), p2(x1 + b, y1 + d);
    pair<long long, long long> p3(x2 - a, y2 - c), p4(x2 + b, y2 + d);
    r = r - ((a + b + UNO) * (c + d + UNO) * DOS);
    r = r + fun(p1, p2, p3, p4);
    cout << r << endl;
  }
}
