#include <bits/stdc++.h>
using namespace std;
long long ab(long long a) {
  if (a < 0) return -a;
  return a;
}
int main(void) {
  int t;
  long long n, m, x1, y1, x2, y2;
  scanf("%d", &t);
  while (t--) {
    scanf("%I64d%I64d%I64d%I64d%I64d%I64d", &n, &m, &x1, &y1, &x2, &y2);
    long long dx = n - ab(x1 - x2), dy = m - ab(y1 - y2), res = n * m;
    res -= 2LL * dx * dy;
    if (2LL * dx > n && 2LL * dy > m) res += (2LL * dx - n) * (2LL * dy - m);
    printf("%I64d\n", res);
  }
  return 0;
}
