#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long T;
  scanf("%lld", &T);
  while (T--) {
    long long n, m, x1, y1, x2, y2;
    scanf("%lld %lld %lld %lld %lld %lld", &n, &m, &x1, &y1, &x2, &y2);
    long long X1 = n - abs(x1 - x2), Y1 = m - abs(y1 - y2), X2 = n - X1 + 1,
              Y2 = m - Y1 + 1;
    long long s1 = X1 * Y1, s2 = (n - X2 + 1) * (m - Y2 + 1);
    long long s3 = (X1 >= X2 && Y1 >= Y2) ? (X1 - X2 + 1) * (Y1 - Y2 + 1) : 0;
    printf("%lld\n", n * m - (s1 + s2 - s3));
  }
  return 0;
}
