#include <bits/stdc++.h>
int main() {
  long long x1, x2, y1, y2, t, n, m, a, b, ans;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld%lld%lld%lld%lld%lld", &n, &m, &x1, &y1, &x2, &y2);
    a = n - abs(x1 - x2);
    b = m - abs(y1 - y2);
    ans = 2 * a * b;
    if (a * 2 > n && b * 2 > m) {
      ans -= (2 * a - n) * (2 * b - m);
    }
    printf("%lld\n", n * m - ans);
  }
  return 0;
}
