#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, xx, yy;
signed main() {
  long long T;
  scanf("%lld", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld%lld%lld", &n, &m, &x, &y, &xx, &yy);
    long long X = abs(x - xx), Y = abs(y - yy);
    long long ans = 2 * (n - X) * (m - Y);
    ans -= (((n - 2 * X) + sqrt((n - 2 * X) * (n - 2 * X))) / 2) *
           (((m - 2 * Y) + sqrt((m - 2 * Y) * (m - 2 * Y))) / 2);
    printf("%lld\n", n * m - ans);
  }
  return 0;
}
