#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, c = getchar(), f = 0;
  for (; c > '9' || c < '0'; f = c == '-', c = getchar())
    ;
  for (; c >= '0' && c <= '9'; x = (x << 1) + (x << 3) + c - '0', c = getchar())
    ;
  return f ? -x : x;
}
int main() {
  for (int test = read(); test--;) {
    long long n = read(), m = read(), x1 = read(), y1 = read(), x2 = read(),
              y2 = read(), x = abs(x1 - x2) + 1, y = abs(y1 - y2) + 1,
              ans = 2 * (n - x + 1) * (m - y + 1);
    if (n - x + 1 >= x && m - y + 1 >= y)
      ans -= (n - x - x + 2) * (m - y - y + 2);
    printf("%I64d\n", n * m - ans);
  }
}
