#include <bits/stdc++.h>
int a, b, c, d, n, m, kolt;
int main() {
  scanf("%d", &kolt);
  for (int h = 0; h < kolt; ++h) {
    scanf("%d%d%d%d%d%d", &n, &m, &a, &b, &c, &d);
    printf("%I64d\n",
           (long long)n * m -
               (long long)(n - abs(a - c)) * (m - abs(b - d)) * 2 +
               std::max((long long)(n - 2 * (abs(a - c) + 1) + 2), 0LL) *
                   std::max((long long)(m - 2 * (abs(b - d) + 1) + 2), 0LL));
  }
}
