#include <bits/stdc++.h>
int main() {
  int t;
  long long a, b, c, d, box1, box2, tt, m, n;
  for (scanf("%d", &t); t--;) {
    scanf("%lld%lld%lld%lld%lld%lld", &n, &m, &a, &b, &c, &d);
    if (c < a) tt = c, c = a, a = tt;
    if (d < b) tt = b, b = d, d = tt;
    c = c - a + 1;
    d = d - b + 1;
    a = 1;
    b = 1;
    box1 = (n - c + 1) * (m - d + 1);
    if (n - c + 1 - c + 1 <= 0 || m - d + 1 - d + 1 <= 0)
      box2 = 0;
    else
      box2 = (n - c + 1 - c + 1) * (m - d + 1 - d + 1);
    printf("%lld\n", (long long)n * m - box1 * 2 + box2);
  }
}
